diff --git a/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java b/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java index 368058925a6..29e5ed8740a 100644 --- a/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +++ b/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java @@ -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; + } + } diff --git a/platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java b/platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java index ce6d462ce84..32d91168562 100644 --- a/platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java +++ b/platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java @@ -35,7 +35,7 @@ public interface ISyncProtocol 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(); diff --git a/platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java b/platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java index 8a2710a9c11..fd4475929c0 100644 --- a/platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java +++ b/platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java @@ -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) diff --git a/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java b/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java index 9c7994ace41..ced5f0ea128 100644 --- a/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +++ b/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java @@ -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() diff --git a/platform/bb/rhodes/src/rhomobile/PushListeningThread.java b/platform/bb/rhodes/src/rhomobile/PushListeningThread.java index adb7481a7a1..36c8957d533 100644 --- a/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +++ b/platform/bb/rhodes/src/rhomobile/PushListeningThread.java @@ -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() { diff --git a/platform/bb/rhodes/src/rhomobile/RhodesApplication.java b/platform/bb/rhodes/src/rhomobile/RhodesApplication.java index 22d40d60afe..259031c591b 100644 --- a/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +++ b/platform/bb/rhodes/src/rhomobile/RhodesApplication.java @@ -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();