diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index aad2ff398dc9..aaf7256a6244 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "94ed925b75d033a1e38577960143c8a627c76deb", + "revision": "9621115bda40a25eb4edff44a142b487a200e558", "repo_path": "/integration/gaia-central" } diff --git a/dom/bluetooth/BluetoothHfpManager.cpp b/dom/bluetooth/BluetoothHfpManager.cpp index 20ec7cd67388..4535a7365ff1 100644 --- a/dom/bluetooth/BluetoothHfpManager.cpp +++ b/dom/bluetooth/BluetoothHfpManager.cpp @@ -1005,8 +1005,14 @@ BluetoothHfpManager::Connect(const nsAString& aDeviceAddress, } if (mSocket) { - DispatchBluetoothReply(aRunnable, BluetoothValue(), - NS_LITERAL_STRING(ERR_REACHED_CONNECTION_LIMIT)); + if (mDeviceAddress == aDeviceAddress) { + DispatchBluetoothReply(aRunnable, BluetoothValue(), + NS_LITERAL_STRING(ERR_ALREADY_CONNECTED)); + } else { + DispatchBluetoothReply(aRunnable, BluetoothValue(), + NS_LITERAL_STRING(ERR_REACHED_CONNECTION_LIMIT)); + } + return; } diff --git a/dom/bluetooth/BluetoothOppManager.cpp b/dom/bluetooth/BluetoothOppManager.cpp index c7a01232a32f..de5784737a89 100644 --- a/dom/bluetooth/BluetoothOppManager.cpp +++ b/dom/bluetooth/BluetoothOppManager.cpp @@ -247,8 +247,13 @@ BluetoothOppManager::Connect(const nsAString& aDeviceAddress, } if (mSocket) { - DispatchBluetoothReply(aRunnable, BluetoothValue(), - NS_LITERAL_STRING(ERR_REACHED_CONNECTION_LIMIT)); + if (mConnectedDeviceAddress == aDeviceAddress) { + DispatchBluetoothReply(aRunnable, BluetoothValue(), + NS_LITERAL_STRING(ERR_ALREADY_CONNECTED)); + } else { + DispatchBluetoothReply(aRunnable, BluetoothValue(), + NS_LITERAL_STRING(ERR_REACHED_CONNECTION_LIMIT)); + } return; } diff --git a/dom/bluetooth/BluetoothProfileManagerBase.h b/dom/bluetooth/BluetoothProfileManagerBase.h index b782e0678768..44a93814112a 100644 --- a/dom/bluetooth/BluetoothProfileManagerBase.h +++ b/dom/bluetooth/BluetoothProfileManagerBase.h @@ -7,9 +7,15 @@ #ifndef mozilla_dom_bluetooth_bluetoothprofilemanagerbase_h__ #define mozilla_dom_bluetooth_bluetoothprofilemanagerbase_h__ -#define ERR_SERVICE_CHANNEL_NOT_FOUND "DeviceChannelRetrievalError" -#define ERR_REACHED_CONNECTION_LIMIT "ReachedConnectionLimitError" -#define ERR_NO_AVAILABLE_RESOURCE "NoAvailableResourceError" +/** + * Error Messages used in Bluetooth profiles + * + * These error messages would be sent to Gaia as an argument of onError event. + */ +#define ERR_ALREADY_CONNECTED "AlreadyConnectedError" +#define ERR_NO_AVAILABLE_RESOURCE "NoAvailableResourceError" +#define ERR_REACHED_CONNECTION_LIMIT "ReachedConnectionLimitError" +#define ERR_SERVICE_CHANNEL_NOT_FOUND "DeviceChannelRetrievalError" #include "BluetoothCommon.h" #include "nsIObserver.h" diff --git a/dom/mobilemessage/src/Makefile.in b/dom/mobilemessage/src/Makefile.in index c96b02ae2813..7c9797b42c78 100644 --- a/dom/mobilemessage/src/Makefile.in +++ b/dom/mobilemessage/src/Makefile.in @@ -15,7 +15,7 @@ include $(DEPTH)/config/autoconf.mk ifeq (android,$(MOZ_WIDGET_TOOLKIT)) VPATH += $(srcdir)/android else ifdef MOZ_B2G_RIL -VPATH += $(srcdir)/ril +VPATH += $(srcdir)/gonk else VPATH += $(srcdir)/fallback endif @@ -44,10 +44,10 @@ LOCAL_INCLUDES += \ $(NULL) EXTRA_COMPONENTS = \ - ril/MmsService.js \ - ril/MmsService.manifest \ - ril/MobileMessageDatabaseService.js \ - ril/MobileMessageDatabaseService.manifest \ + gonk/MmsService.js \ + gonk/MmsService.manifest \ + gonk/MobileMessageDatabaseService.js \ + gonk/MobileMessageDatabaseService.manifest \ $(NULL) endif diff --git a/dom/mobilemessage/src/ril/MmsPduHelper.jsm b/dom/mobilemessage/src/gonk/MmsPduHelper.jsm similarity index 100% rename from dom/mobilemessage/src/ril/MmsPduHelper.jsm rename to dom/mobilemessage/src/gonk/MmsPduHelper.jsm diff --git a/dom/mobilemessage/src/ril/MmsService.js b/dom/mobilemessage/src/gonk/MmsService.js similarity index 99% rename from dom/mobilemessage/src/ril/MmsService.js rename to dom/mobilemessage/src/gonk/MmsService.js index 22591979b113..d594534a51b9 100644 --- a/dom/mobilemessage/src/ril/MmsService.js +++ b/dom/mobilemessage/src/gonk/MmsService.js @@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); +Cu.import("resource://gre/modules/PhoneNumberUtils.jsm"); const RIL_MMSSERVICE_CONTRACTID = "@mozilla.org/mms/rilmmsservice;1"; const RIL_MMSSERVICE_CID = Components.ID("{217ddd76-75db-4210-955d-8806cd8d87f9}"); @@ -1571,7 +1572,11 @@ MmsService.prototype = { if (receivers.length != 0) { let headersTo = headers["to"] = []; for (let i = 0; i < receivers.length; i++) { - headersTo.push({"address": receivers[i], "type": "PLMN"}); + let normalizedAddress = PhoneNumberUtils.normalize(receivers[i], false); + if (DEBUG) debug("createSavableFromParams: normalize phone number " + + "from " + receivers[i] + " to " + normalizedAddress); + + headersTo.push({"address": normalizedAddress, "type": "PLMN"}); } } if (aParams.subject) { diff --git a/dom/mobilemessage/src/ril/MmsService.manifest b/dom/mobilemessage/src/gonk/MmsService.manifest similarity index 100% rename from dom/mobilemessage/src/ril/MmsService.manifest rename to dom/mobilemessage/src/gonk/MmsService.manifest diff --git a/dom/mobilemessage/src/ril/MobileMessageDatabaseService.js b/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js similarity index 100% rename from dom/mobilemessage/src/ril/MobileMessageDatabaseService.js rename to dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js diff --git a/dom/mobilemessage/src/ril/MobileMessageDatabaseService.manifest b/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.manifest similarity index 100% rename from dom/mobilemessage/src/ril/MobileMessageDatabaseService.manifest rename to dom/mobilemessage/src/gonk/MobileMessageDatabaseService.manifest diff --git a/dom/mobilemessage/src/ril/SmsService.cpp b/dom/mobilemessage/src/gonk/SmsService.cpp similarity index 100% rename from dom/mobilemessage/src/ril/SmsService.cpp rename to dom/mobilemessage/src/gonk/SmsService.cpp diff --git a/dom/mobilemessage/src/ril/SmsService.h b/dom/mobilemessage/src/gonk/SmsService.h similarity index 100% rename from dom/mobilemessage/src/ril/SmsService.h rename to dom/mobilemessage/src/gonk/SmsService.h diff --git a/dom/mobilemessage/src/ril/WspPduHelper.jsm b/dom/mobilemessage/src/gonk/WspPduHelper.jsm similarity index 100% rename from dom/mobilemessage/src/ril/WspPduHelper.jsm rename to dom/mobilemessage/src/gonk/WspPduHelper.jsm diff --git a/dom/mobilemessage/src/ril/mms_consts.js b/dom/mobilemessage/src/gonk/mms_consts.js similarity index 100% rename from dom/mobilemessage/src/ril/mms_consts.js rename to dom/mobilemessage/src/gonk/mms_consts.js diff --git a/dom/mobilemessage/src/ril/wap_consts.js b/dom/mobilemessage/src/gonk/wap_consts.js similarity index 100% rename from dom/mobilemessage/src/ril/wap_consts.js rename to dom/mobilemessage/src/gonk/wap_consts.js diff --git a/dom/mobilemessage/src/moz.build b/dom/mobilemessage/src/moz.build index e742dabbc836..687de5810eb2 100644 --- a/dom/mobilemessage/src/moz.build +++ b/dom/mobilemessage/src/moz.build @@ -7,7 +7,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': mmsdir = 'android' elif CONFIG['MOZ_B2G_RIL']: - mmsdir = 'ril' + mmsdir = 'gonk' else: mmsdir = 'fallback' @@ -23,10 +23,10 @@ EXPORTS.mozilla.dom.mobilemessage += [ if CONFIG['MOZ_B2G_RIL']: EXTRA_JS_MODULES = [ - 'ril/MmsPduHelper.jsm', - 'ril/WspPduHelper.jsm', - 'ril/mms_consts.js', - 'ril/wap_consts.js', + 'gonk/MmsPduHelper.jsm', + 'gonk/WspPduHelper.jsm', + 'gonk/mms_consts.js', + 'gonk/wap_consts.js', ] else: EXPORTS.mozilla.dom.mobilemessage += [ diff --git a/dom/push/src/PushService.jsm b/dom/push/src/PushService.jsm index fc9a4c3e06d7..f4e956c21c31 100644 --- a/dom/push/src/PushService.jsm +++ b/dom/push/src/PushService.jsm @@ -678,8 +678,15 @@ this.PushService = { else if (this._currentState == STATE_READY) { // Send a ping. // Bypass the queue; we don't want this to be kept pending. - this._ws.sendMsg('{}'); - debug("Sent ping."); + // Watch out for exception in case the socket has disconnected. + // When this happens, we pretend the ping was sent and don't specially + // handle the exception, as the lack of a pong will lead to the socket + // being reset. + try { + this._ws.sendMsg('{}'); + } catch (e) { + } + this._waitingForPong = true; this._setAlarm(prefs.get("requestTimeout")); }