Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bb: support push_type in clientregister

  • Loading branch information...
commit 4c70b18b0f11ba1f1f0537a0bd9952dfc2bf8b69 1 parent e2a05d8
genywind genywind authored
26 platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java
View
@@ -102,7 +102,8 @@ public String getRegisterBody(String strClientID)throws Exception
int port = RhoConf.getInstance().getInt("push_port");
return SyncThread.getSyncEngine().getProtocol().getClientRegisterBody( strClientID, m_strDevicePin,
- port > 0 ? port : DEFAULT_PUSH_PORT, m_sysInfo.getPlatform());
+ port > 0 ? port : DEFAULT_PUSH_PORT, m_sysInfo.getPlatform(),
+ isPushServiceEnabled() ? "bis" : "" );
}
private boolean doRegister( SyncEngine oSync )throws Exception
@@ -147,5 +148,26 @@ private boolean doRegister( SyncEngine oSync )throws Exception
}
return false;
- }
+ }
+
+ public static boolean isMDSPushEnabled()
+ {
+ if ( !RhoConf.getInstance().isExist("push_options") )
+ return true;
+
+ String strOptions = RhoConf.getInstance().getString("push_options");
+
+ return strOptions.indexOf("mds") >= 0;
+ }
+
+ public static boolean isPushServiceEnabled()
+ {
+ if ( !RhoConf.getInstance().isExist("push_options") )
+ return false;
+
+ String strOptions = RhoConf.getInstance().getString("push_options");
+
+ return strOptions.indexOf("push_service") >= 0;
+ }
+
}
2  platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java
View
@@ -35,7 +35,7 @@
public abstract String getClientCreateUrl();
public abstract String getClientRegisterUrl();
- public abstract String getClientRegisterBody( String strClientID, String strPin, int nPort, String strType );
+ public abstract String getClientRegisterBody( String strClientID, String strPin, int nPort, String strType, String strPushType );
public abstract String getClientResetUrl(String strClientID);
public abstract String getClientChangesUrl();
5 platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java
View
@@ -61,12 +61,13 @@ public String getClientRegisterUrl()
return RhoConf.getInstance().getPath("syncserver") + "clientregister";
}
- public String getClientRegisterBody( String strClientID, String strPin, int nPort, String strType )
+ public String getClientRegisterBody( String strClientID, String strPin, int nPort, String strType, String strPushType )
{
return "{\"client_id\":" + JSONEntry.quoteValue(strClientID) +
",\"device_pin\":" + JSONEntry.quoteValue(strPin) +
",\"device_port\":\"" + nPort +
- "\",\"device_type\":" + JSONEntry.quoteValue(strType) + "}";
+ "\",\"device_type\":" + JSONEntry.quoteValue(strType) +
+ "\",\"push_type\":" + JSONEntry.quoteValue(strPushType) + "}";
}
public String getClientResetUrl(String strClientID)
2  platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java
View
@@ -225,7 +225,7 @@ public void onPlatformActivate()
{
if ( com.rho.Capabilities.ENABLE_PUSH )
{
- if ( !rhomobile.PushListeningThread.isPushServiceEnabled() )
+ if ( !com.rho.sync.ClientRegister.isPushServiceEnabled() )
return;
getUiApplication().invokeLater( new Runnable()
20 platform/bb/rhodes/src/rhomobile/PushListeningThread.java
View
@@ -72,26 +72,6 @@ protected synchronized void stop()
}
}
- public static boolean isMDSPushEnabled()
- {
- if ( !RhoConf.getInstance().isExist("push_options") )
- return true;
-
- String strOptions = RhoConf.getInstance().getString("push_options");
-
- return strOptions.indexOf("mds") >= 0;
- }
-
- public static boolean isPushServiceEnabled()
- {
- if ( !RhoConf.getInstance().isExist("push_options") )
- return false;
-
- String strOptions = RhoConf.getInstance().getString("push_options");
-
- return strOptions.indexOf("push_service") >= 0;
- }
-
public void run()
{
2  platform/bb/rhodes/src/rhomobile/RhodesApplication.java
View
@@ -1462,7 +1462,7 @@ public void run()
if ( com.rho.Capabilities.ENABLE_PUSH )
{
- if ( PushListeningThread.isMDSPushEnabled() )
+ if ( com.rho.sync.ClientRegister.isMDSPushEnabled() )
{
_pushListeningThread = new PushListeningThread();
_pushListeningThread.start();
Please sign in to comment.
Something went wrong with that request. Please try again.