Merge m-c to inbound.

This commit is contained in:
Ryan VanderMeulen 2014-03-13 15:35:43 -04:00
commit ddafbb93e1
20 changed files with 108 additions and 175 deletions

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="b5151b89ff31e92dc44b466f15ad4909e73db248"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="485846b2a40d8ac7d6c1c5f8af6d15b0c10af19d"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="a9e08b91e9cd1f0930f16cfc49ec72f63575d5fe">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="b5151b89ff31e92dc44b466f15ad4909e73db248"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

View File

@ -4,6 +4,6 @@
"branch": "",
"revision": ""
},
"revision": "3981aa44b3b0c977fbb34d0203594474b48b5b74",
"revision": "2900811db1282799596e70db1152348f6700ad37",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="b5151b89ff31e92dc44b466f15ad4909e73db248"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="485846b2a40d8ac7d6c1c5f8af6d15b0c10af19d"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b5d0f9b0cd5dce38b79287a9363226b912929270"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ea9e23abea5933656555d849b922c8da7530c90b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

View File

@ -910,6 +910,9 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration,
#if ANDROID_VERSION > 17
NS_ENSURE_TRUE_VOID(sBtAvrcpInterface);
// always update playstatus first
sBtAvrcpInterface->get_play_status_rsp((btrc_play_status_t)aPlayStatus,
aDuration, aPosition);
// when play status changed, send both play status and position
if (mPlayStatus != aPlayStatus &&
mPlayStatusChangedNotifyType == BTRC_NOTIFICATION_TYPE_INTERIM) {
@ -931,8 +934,6 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration,
&param);
}
sBtAvrcpInterface->get_play_status_rsp((btrc_play_status_t)aPlayStatus,
aDuration, aPosition);
mDuration = aDuration;
mPosition = aPosition;
mPlayStatus = aPlayStatus;
@ -958,7 +959,7 @@ BluetoothA2dpManager::UpdateRegisterNotification(int aEventId, int aParam)
switch (aEventId) {
case BTRC_EVT_PLAY_STATUS_CHANGED:
mPlayPosChangedNotifyType = BTRC_NOTIFICATION_TYPE_INTERIM;
mPlayStatusChangedNotifyType = BTRC_NOTIFICATION_TYPE_INTERIM;
param.play_status = (btrc_play_status_t)mPlayStatus;
break;
case BTRC_EVT_TRACK_CHANGE:

View File

@ -9,8 +9,6 @@ disabled = Bug 808783
[test_mobile_voice_location.js]
[test_mobile_operator_names.js]
[test_mobile_preferred_network_type.js]
[test_mobile_preferred_network_type_by_setting.js]
disabled = Bug 808783
[test_mobile_data_connection.js]
[test_mobile_data_location.js]
[test_mobile_data_state.js]

View File

@ -1,65 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
const KEY = "ril.radio.preferredNetworkType";
SpecialPowers.addPermission("mobileconnection", true, document);
SpecialPowers.addPermission("settings-read", true, document);
SpecialPowers.addPermission("settings-write", true, document);
let settings = window.navigator.mozSettings;
function test_revert_previous_setting_on_invalid_value() {
log("Testing reverting to previous setting on invalid value received");
let getLock = settings.createLock();
let getReq = getLock.get(KEY);
getReq.addEventListener("success", function onGetSuccess() {
let originalValue = getReq.result[KEY] || "wcdma/gsm";
let setDone = false;
settings.addObserver(KEY, function observer(setting) {
// Mark if the invalid value has been set in db and wait.
if (setting.settingValue == obj[KEY]) {
setDone = true;
return;
}
// Skip any change before marking but keep it as original value.
if (!setDone) {
originalValue = setting.settingValue;
return;
}
settings.removeObserver(KEY, observer);
is(setting.settingValue, originalValue, "Settings reverted");
window.setTimeout(cleanUp, 0);
});
let obj = {};
obj[KEY] = "AnInvalidValue";
let setLock = settings.createLock();
setLock.set(obj);
setLock.addEventListener("error", function onSetError() {
ok(false, "cannot set '" + KEY + "'");
});
});
getReq.addEventListener("error", function onGetError() {
ok(false, "cannot get default value of '" + KEY + "'");
});
}
function cleanUp() {
SpecialPowers.removePermission("mobileconnection", document);
SpecialPowers.removePermission("settings-write", document);
SpecialPowers.removePermission("settings-read", document);
finish();
}
waitFor(test_revert_previous_setting_on_invalid_value, function() {
return navigator.mozMobileConnections[0].voice.connected;
});

View File

@ -1877,9 +1877,6 @@ function RadioInterface(aClientId, aWorkerMessenger) {
let lock = gSettingsService.createLock();
// Read preferred network type from the setting DB.
lock.get("ril.radio.preferredNetworkType", this);
// Read the "time.clock.automatic-update.enabled" setting to see if
// we need to adjust the system clock time by NITZ or SNTP.
lock.get(kSettingsClockAutoUpdateEnabled, this);
@ -2508,16 +2505,10 @@ RadioInterface.prototype = {
connHandler.updateRILNetworkInterface();
},
_preferredNetworkType: null,
getPreferredNetworkType: function(target, message) {
this.workerMessenger.send("getPreferredNetworkType", message, (function(response) {
if (response.success) {
this._preferredNetworkType = response.networkType;
response.type = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[this._preferredNetworkType];
if (DEBUG) {
this.debug("_preferredNetworkType is now " +
RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[this._preferredNetworkType]);
}
response.type = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[response.networkType];
}
target.sendAsyncMessage("RIL:GetPreferredNetworkType", {
@ -2529,7 +2520,6 @@ RadioInterface.prototype = {
},
setPreferredNetworkType: function(target, message) {
if (DEBUG) this.debug("setPreferredNetworkType: " + JSON.stringify(message));
let networkType = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO.indexOf(message.type);
if (networkType < 0) {
message.errorMsg = RIL.GECKO_ERROR_INVALID_PARAMETER;
@ -2542,14 +2532,6 @@ RadioInterface.prototype = {
message.networkType = networkType;
this.workerMessenger.send("setPreferredNetworkType", message, (function(response) {
if (response.success) {
this._preferredNetworkType = response.networkType;
if (DEBUG) {
this.debug("_preferredNetworkType is now " +
RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[this._preferredNetworkType]);
}
}
target.sendAsyncMessage("RIL:SetPreferredNetworkType", {
clientId: this.clientId,
data: response
@ -2558,43 +2540,6 @@ RadioInterface.prototype = {
}).bind(this));
},
// TODO: Bug 946589 - B2G RIL: follow-up to bug 944225 - remove
// 'ril.radio.preferredNetworkType' setting handler
setPreferredNetworkTypeBySetting: function(value) {
let networkType = RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO.indexOf(value);
if (networkType < 0) {
networkType = (this._preferredNetworkType != null)
? RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[this._preferredNetworkType]
: RIL.GECKO_PREFERRED_NETWORK_TYPE_DEFAULT;
gSettingsService.createLock().set("ril.radio.preferredNetworkType",
networkType, null);
return;
}
if (networkType == this._preferredNetworkType) {
return;
}
this.workerMessenger.send("setPreferredNetworkType",
{ networkType: networkType },
(function(response) {
if ((this._preferredNetworkType != null) && !response.success) {
gSettingsService.createLock().set("ril.radio.preferredNetworkType",
this._preferredNetworkType,
null);
return false;
}
this._preferredNetworkType = response.networkType;
if (DEBUG) {
this.debug("_preferredNetworkType is now " +
RIL.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO[this._preferredNetworkType]);
}
return false;
}).bind(this));
},
setCellBroadcastSearchList: function(newSearchListStr) {
if (newSearchListStr == this._cellBroadcastSearchListStr) {
return;
@ -3277,12 +3222,6 @@ RadioInterface.prototype = {
// nsISettingsServiceCallback
handle: function(aName, aResult) {
switch(aName) {
// TODO: Bug 946589 - B2G RIL: follow-up to bug 944225 - remove
// 'ril.radio.preferredNetworkType' setting handler
case "ril.radio.preferredNetworkType":
if (DEBUG) this.debug("'ril.radio.preferredNetworkType' is now " + aResult);
this.setPreferredNetworkTypeBySetting(aResult);
break;
case kSettingsClockAutoUpdateEnabled:
this._clockAutoUpdateEnabled = aResult;
if (!this._clockAutoUpdateEnabled) {

View File

@ -415,7 +415,6 @@ this.GECKO_PREFERRED_NETWORK_TYPE_LTE_CDMA_EVDO = "lte/cdma/evdo";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM = "lte/wcdma/gsm";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO = "lte/wcdma/gsm/cdma/evdo";
this.GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY = "lte";
this.GECKO_PREFERRED_NETWORK_TYPE_DEFAULT = GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM;
this.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [
GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM,
GECKO_PREFERRED_NETWORK_TYPE_GSM_ONLY,

View File

@ -6136,13 +6136,8 @@ RilObject.prototype[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function REQUEST_GET_P
return;
}
let Buf = this.context.Buf;
let networkType = RIL_PREFERRED_NETWORK_TYPE_TO_GECKO.indexOf(GECKO_PREFERRED_NETWORK_TYPE_DEFAULT);
let responseLen = Buf.readInt32(); // Number of INT32 responsed.
if (responseLen) {
this.preferredNetworkType = networkType = Buf.readInt32();
}
options.networkType = networkType;
let results = this.context.Buf.readInt32List();
options.networkType = this.preferredNetworkType = results[0];
options.success = true;
this.sendChromeMessage(options);
@ -14462,6 +14457,10 @@ ICCContactHelperObject.prototype = {
(Array.isArray(contact.anr) && contact.anr[0]))) {
// Case 1.
this.addContactFieldType2(pbr, contact, field, onsuccess, onerror);
} else {
if (onsuccess) {
onsuccess();
}
}
return;
}

View File

@ -1684,7 +1684,7 @@ add_test(function test_update_icc_contact() {
let contactHelper = context.ICCContactHelper;
let ril = context.RIL;
function do_test(aSimType, aContactType, aContact, aPin2, aFileType, aEnhancedPhoneBook) {
function do_test(aSimType, aContactType, aContact, aPin2, aFileType, aHaveIapIndex, aEnhancedPhoneBook) {
ril.appType = aSimType;
ril._isCdma = (aSimType === CARD_APPTYPE_RUIM);
ril.iccInfoPrivate.cst = (aEnhancedPhoneBook) ? [0x0, 0x0C, 0x0, 0x0, 0x0]
@ -1729,7 +1729,14 @@ add_test(function test_update_icc_contact() {
recordHelper.readIAP = function(fileId, recordNumber, onsuccess, onerror) {
do_check_eq(fileId, IAP_FILE_ID);
do_check_eq(recordNumber, ADN_RECORD_ID);
onsuccess([EMAIL_RECORD_ID, ANR0_RECORD_ID]);
onsuccess((aHaveIapIndex) ? [EMAIL_RECORD_ID, ANR0_RECORD_ID]
: [0xff, 0xff]);
};
recordHelper.updateIAP = function(fileId, recordNumber, iap, onsuccess, onerror) {
do_check_eq(fileId, IAP_FILE_ID);
do_check_eq(recordNumber, ADN_RECORD_ID);
onsuccess();
};
recordHelper.updateEmail = function(pbr, recordNumber, email, adnRecordId, onsuccess, onerror) {
@ -1756,16 +1763,28 @@ add_test(function test_update_icc_contact() {
onsuccess();
};
recordHelper.findFreeRecordId = function(fileId, onsuccess, onerror) {
let recordId = 0;
if (fileId === EMAIL_FILE_ID) {
recordId = EMAIL_RECORD_ID;
} else if (fileId === ANR0_FILE_ID) {
recordId = ANR0_RECORD_ID;
}
onsuccess(recordId);
};
let isSuccess = false;
let onsuccess = function onsuccess() {
do_print("updateICCContact success");
isSuccess = true;
};
let onerror = function onerror(errorMsg) {
do_print("updateICCContact failed: " + errorMsg);
do_check_true(false);
};
contactHelper.updateICCContact(aSimType, aContactType, aContact, aPin2, onsuccess, onerror);
do_check_true(isSuccess);
}
let contacts = [
@ -1783,6 +1802,22 @@ add_test(function test_update_icc_contact() {
recordId: ADN_RECORD_ID,
alphaId: "test2",
number: "123456",
},
// a contact with email but no anr.
{
pbrIndex: 0,
recordId: ADN_RECORD_ID,
alphaId: "test3",
number: "123456",
email: "test@mail.com"
},
// a contact with anr but no email.
{
pbrIndex: 0,
recordId: ADN_RECORD_ID,
alphaId: "test4",
number: "123456",
anr: ["+654321"]
}];
for (let i = 0; i < contacts.length; i++) {
@ -1797,7 +1832,8 @@ add_test(function test_update_icc_contact() {
// USIM
do_print("Test update USIM adn contacts");
do_test(CARD_APPTYPE_USIM, "adn", contact, null, ICC_USIM_TYPE1_TAG);
do_test(CARD_APPTYPE_USIM, "adn", contact, null, ICC_USIM_TYPE2_TAG);
do_test(CARD_APPTYPE_USIM, "adn", contact, null, ICC_USIM_TYPE2_TAG, true);
do_test(CARD_APPTYPE_USIM, "adn", contact, null, ICC_USIM_TYPE2_TAG, false);
do_print("Test update USIM fdn contacts");
do_test(CARD_APPTYPE_USIM, "fdn", contact, "1234");
@ -1811,8 +1847,9 @@ add_test(function test_update_icc_contact() {
// RUIM with enhanced phone book
do_print("Test update RUIM adn contacts with enhanced phone book");
do_test(CARD_APPTYPE_RUIM, "adn", contact, null, ICC_USIM_TYPE1_TAG, true);
do_test(CARD_APPTYPE_RUIM, "adn", contact, null, ICC_USIM_TYPE2_TAG, true);
do_test(CARD_APPTYPE_RUIM, "adn", contact, null, ICC_USIM_TYPE1_TAG, null, true);
do_test(CARD_APPTYPE_RUIM, "adn", contact, null, ICC_USIM_TYPE2_TAG, true, true);
do_test(CARD_APPTYPE_RUIM, "adn", contact, null, ICC_USIM_TYPE2_TAG, false, true);
do_print("Test update RUIM fdn contacts with enhanced phone book");
do_test(CARD_APPTYPE_RUIM, "fdn", contact, "1234", null, true);

View File

@ -135,84 +135,75 @@ DOMWifiManager.prototype = {
return;
let request;
if (msg.rid) {
request = this.takeRequest(msg.rid);
if (!request) {
return;
}
}
switch (aMessage.name) {
case "WifiManager:getNetworks:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
break;
case "WifiManager:getNetworks:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, "Unable to scan for networks");
break;
case "WifiManager:getKnownNetworks:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
break;
case "WifiManager:getKnownNetworks:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, "Unable to get known networks");
break;
case "WifiManager:associate:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, true);
break;
case "WifiManager:associate:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, "Unable to add the network");
break;
case "WifiManager:forget:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, true);
break;
case "WifiManager:forget:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, msg.data);
break;
case "WifiManager:wps:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
break;
case "WifiManager:wps:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, msg.data);
break;
case "WifiManager:setPowerSavingMode:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
break;
case "WifiManager:setPowerSavingMode:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, msg.data);
break;
case "WifiManager:setHttpProxy:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
break;
case "WifiManager:setHttpProxy:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, msg.data);
break;
case "WifiManager:setStaticIpMode:Return:OK":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
break;
case "WifiManager:setStaticIpMode:Return:NO":
request = this.takeRequest(msg.rid);
Services.DOMRequest.fireError(request, msg.data);
break;

View File

@ -2304,8 +2304,10 @@ WifiWorker.prototype = {
// Convert between netId-based and ssid-based indexing.
for (let net in networks) {
let network = networks[net];
delete networks[net];
if (!network.ssid) {
delete networks[net]; // TODO support these?
WifiManager.removeNetwork(network.netId, function() {});
continue;
}
@ -2313,8 +2315,11 @@ WifiWorker.prototype = {
this._highestPriority = network.priority;
let networkKey = getNetworkKey(network);
// Accept latest config of same network(same SSID and same security).
if (networks[networkKey]) {
WifiManager.removeNetwork(networks[networkKey].netId, function() {});
}
networks[networkKey] = network;
delete networks[net];
}
this.configuredNetworks = networks;
@ -2402,6 +2407,25 @@ WifiWorker.prototype = {
_sendMessage: function(message, success, data, msg) {
msg.manager.sendAsyncMessage(message + (success ? ":OK" : ":NO"),
{ data: data, rid: msg.rid, mid: msg.mid });
this._splicePendingRequest(msg);
},
_domRequest: [],
_splicePendingRequest: function(msg) {
for (let i = 0; i < this._domRequest.length; i++) {
if (this._domRequest[i].msg === msg) {
this._domRequest.splice(i, 1);
return;
}
}
},
_clearPendingRequest: function() {
if (this._domRequest.length === 0) return;
this._domRequest.forEach(function(req) {
this._sendMessage(req.name + ":Return", false, "Wifi is disabled", req.msg);
});
},
receiveMessage: function MessageManager_receiveMessage(aMessage) {
@ -2433,6 +2457,11 @@ WifiWorker.prototype = {
return;
}
// We are interested in DOMRequests only.
if (aMessage.name != "WifiManager:getState") {
this._domRequest.push({name: aMessage.name, msg:msg});
}
switch (aMessage.name) {
case "WifiManager:getNetworks":
this.getNetworks(msg);
@ -2612,6 +2641,11 @@ WifiWorker.prototype = {
},
setWifiEnabled: function(enabled, callback) {
// Reply error to pending requests.
if (!enabled) {
this._clearPendingRequest();
}
WifiManager.setWifiEnabled(enabled, callback);
},