merge b2g-inbound to mozilla-central

This commit is contained in:
Carsten "Tomcat" Book 2014-05-07 14:11:38 +02:00
Родитель 26cdcf20ae 591d0418e1
Коммит 2ff2afa66e
25 изменённых файлов: 233 добавлений и 106 удалений

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
@ -102,7 +102,7 @@
<project name="platform/external/iproute2" path="external/iproute2" revision="c66c5716d5335e450f7a7b71ccc6a604fb2f41d2"/>
<project name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="d2685281e2e54ca14d1df304867aa82c37b27162"/>
<project name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="627f9b20fc518937b93747a7ff1ed4f5ed46e06f"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="10977f28df27f79534f079c0a9852b21a5a0f6da"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="f19ba22ba6973804628781606bc072d18f3f79c2"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="431afac2ebfdd9c1c8402b413ff5914ed448e961"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="4f46930827957afbce500a4a920755a218bf3155"/>
</manifest>

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3691614d0045f7968addce45d4140fb360c3ceaf"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
@ -102,7 +102,7 @@
<project name="platform/external/iproute2" path="external/iproute2" revision="c66c5716d5335e450f7a7b71ccc6a604fb2f41d2"/>
<project name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="d2685281e2e54ca14d1df304867aa82c37b27162"/>
<project name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="627f9b20fc518937b93747a7ff1ed4f5ed46e06f"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="10977f28df27f79534f079c0a9852b21a5a0f6da"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="f19ba22ba6973804628781606bc072d18f3f79c2"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="431afac2ebfdd9c1c8402b413ff5914ed448e961"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="4f46930827957afbce500a4a920755a218bf3155"/>
</manifest>

Просмотреть файл

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3691614d0045f7968addce45d4140fb360c3ceaf"/>
@ -129,7 +129,7 @@
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="494c177966fdc31183a5f7af82dc9130f523da4b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="320b05a5761eb2a4816f7529c91ea49422979b55"/>
<project name="platform/frameworks/av" path="frameworks/av" revision="1df6dac11d7370a2fffca8e31d65b80f537faec5"/>
<project name="platform/frameworks/base" path="frameworks/base" revision="807d87d5ff66cb5e0664f6924f612fcdb5e2c453"/>
<project name="platform/frameworks/base" path="frameworks/base" revision="eed05deb23b612ef6b415a039c9e77483669b0c4"/>
<project name="platform/frameworks/native" path="frameworks/native" revision="33a2b51f78416536e1bfba0c0b7776db307f3a4f"/>
<project name="platform/hardware/libhardware" path="hardware/libhardware" revision="484802559ed106bac4811bd01c024ca64f741e60"/>
<project name="platform/hardware/qcom/audio" path="hardware/qcom/audio" revision="d30227d7ae5cbe8bac8775358b472f44504a20d2"/>
@ -140,7 +140,7 @@
<project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="2208fa3537ace873b8f9ec2355055761c79dfd5f"/>
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="e284280277c1312017a9450956a9676584441cdf"/>
<project name="platform/system/core" path="system/core" revision="81c9921fcf372228aab336ff7cf0076c66505af0"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="f620016437dd2f050e044eccef5e70e3f689ccbe"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="b3001d5f1686f89995b7bf70963cf69c8faebd83"/>

Просмотреть файл

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "cbd0b3d032bd97c35448bd906fde77e2cfb0967d",
"revision": "787e0db2b536a3f1105c12819d48a8a584d5d4d6",
"repo_path": "/integration/gaia-central"
}

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3691614d0045f7968addce45d4140fb360c3ceaf"/>

Просмотреть файл

@ -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="870a5c518742665d36b17e7e88c2ab07d440b94c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="347d0517f0a77122c876d5f62c0942006a7a0bfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="f313e6d3aaaefe8c82eaed15912a09b120fb7260"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

Просмотреть файл

@ -19,9 +19,11 @@ const Ci = Components.interfaces;
this.EXPORTED_SYMBOLS = ["IndexedDBHelper"];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.importGlobalProperties(["indexedDB"]);
XPCOMUtils.defineLazyModuleGetter(this, 'Services',
'resource://gre/modules/Services.jsm');
this.IndexedDBHelper = function IndexedDBHelper() {}
IndexedDBHelper.prototype = {
@ -88,7 +90,10 @@ IndexedDBHelper.prototype = {
ensureDB: function ensureDB(aSuccessCb, aFailureCb) {
if (this._db) {
if (DEBUG) debug("ensureDB: already have a database, returning early.");
aSuccessCb && aSuccessCb();
if (aSuccessCb) {
Services.tm.currentThread.dispatch(aSuccessCb,
Ci.nsIThread.DISPATCH_NORMAL);
}
return;
}
this.open(aSuccessCb, aFailureCb);

Просмотреть файл

@ -69,7 +69,6 @@ BluetoothProfileController::BluetoothProfileController(
mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
MOZ_ASSERT(mTimer);
mCheckProfileStatusCallback = new CheckProfileStatusCallback(this);
mProfiles.Clear();
/**
@ -225,8 +224,8 @@ BluetoothProfileController::StartSession()
}
if (mTimer) {
mTimer->InitWithCallback(mCheckProfileStatusCallback, CONNECTION_TIMEOUT_MS,
nsITimer::TYPE_ONE_SHOT);
mTimer->InitWithCallback(new CheckProfileStatusCallback(this),
CONNECTION_TIMEOUT_MS, nsITimer::TYPE_ONE_SHOT);
}
BT_LOGR("%s", mConnect ? "connecting" : "disconnecting");

Просмотреть файл

@ -139,7 +139,6 @@ private:
} mTarget;
nsCOMPtr<nsITimer> mTimer;
nsCOMPtr<nsITimerCallback> mCheckProfileStatusCallback;
};
END_BLUETOOTH_NAMESPACE

Просмотреть файл

@ -6,4 +6,6 @@ qemu=true
[test_ndef.js]
[test_nfc_enabled.js]
[test_nfc_manager_tech_discovered.js]
disabled = Bug 996426
[test_nfc_peer.js]
disabled = Bug 996426

Просмотреть файл

@ -18,7 +18,7 @@ function handleTechnologyDiscoveredRE0(msg) {
function activateRE(re) {
let deferred = Promise.defer();
let cmd = 'nfc ntf rf_intf_activated ' + re;
let cmd = 'nfc nci rf_intf_activated_ntf ' + re;
emulator.run(cmd, function(result) {
is(result.pop(), 'OK', 'check activation of RE' + re);
@ -30,7 +30,7 @@ function activateRE(re) {
function notifyDiscoverRE(re, type) {
let deferred = Promise.defer();
let cmd = 'nfc ntf rf_discover ' + re + ' ' + type;
let cmd = 'nfc nci rf_discover_ntf ' + re + ' ' + type;
emulator.run(cmd, function(result) {
is(result.pop(), 'OK', 'check discover of RE' + re);

Просмотреть файл

@ -61,7 +61,7 @@ function handleTechnologyDiscoveredRE0ForP2PRegFailure(msg) {
function activateRE(re) {
let deferred = Promise.defer();
let cmd = "nfc ntf rf_intf_activated " + re;
let cmd = "nfc nci rf_intf_activated_ntf " + re;
emulator.run(cmd, function(result) {
is(result.pop(), "OK", "check activation of RE" + re);

Просмотреть файл

@ -32,6 +32,13 @@ function SettingsLock(aSettingsManager) {
this._requests = new Queue();
this._settingsManager = aSettingsManager;
this._transaction = null;
let closeHelper = function() {
if (DEBUG) debug("closing lock");
this._open = false;
}.bind(this);
Services.tm.currentThread.dispatch(closeHelper, Ci.nsIThread.DISPATCH_NORMAL);
}
SettingsLock.prototype = {
@ -65,11 +72,13 @@ SettingsLock.prototype = {
break;
case "set":
let keys = Object.getOwnPropertyNames(info.settings);
if (keys.length) {
lock._isBusy = true;
}
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let last = i === keys.length - 1;
if (DEBUG) debug("key: " + key + ", val: " + JSON.stringify(info.settings[key]) + ", type: " + typeof(info.settings[key]));
lock._isBusy = true;
let checkKeyRequest = store.get(key);
checkKeyRequest.onsuccess = function (event) {
@ -87,15 +96,11 @@ SettingsLock.prototype = {
let setReq = store.put(obj);
setReq.onsuccess = function() {
lock._isBusy = false;
cpmm.sendAsyncMessage("Settings:Changed", { key: key, value: userValue });
if (last && !request.error) {
lock._open = true;
Services.DOMRequest.fireSuccess(request, 0);
lock._open = false;
if (!lock._requests.isEmpty()) {
lock.process();
}
}
};
@ -104,6 +109,13 @@ SettingsLock.prototype = {
Services.DOMRequest.fireError(request, setReq.error.name)
}
};
if (last) {
lock._isBusy = false;
if (!lock._requests.isEmpty()) {
lock.process();
}
}
};
checkKeyRequest.onerror = function(event) {
if (!request.error) {
@ -111,7 +123,9 @@ SettingsLock.prototype = {
}
};
}
break;
// Don't break here, instead return. Once the previous requests have
// finished this loop will start again.
return;
case "get":
let getReq = (info.name === "*") ? store.mozGetAll()
: store.mozGetAll(info.name);
@ -148,22 +162,20 @@ SettingsLock.prototype = {
},
createTransactionAndProcess: function() {
if (this._settingsManager._settingsDB._db) {
var lock;
while (lock = this._settingsManager._locks.dequeue()) {
if (!lock._transaction) {
let transactionType = this._settingsManager.hasWritePrivileges ? "readwrite" : "readonly";
lock._transaction = lock._settingsManager._settingsDB._db.transaction(SETTINGSSTORE_NAME, transactionType);
}
if (!lock._isBusy) {
lock.process();
} else {
this._settingsManager._locks.enqueue(lock);
}
}
if (!this._requests.isEmpty() && !this._isBusy) {
this.process();
}
if (DEBUG) debug("database opened, creating transaction");
let manager = this._settingsManager;
let transactionType = manager.hasWritePrivileges ? "readwrite" : "readonly";
this._transaction =
manager._settingsDB._db.transaction(SETTINGSSTORE_NAME, transactionType);
this.process();
},
maybeProcess: function() {
if (this._transaction && !this._isBusy) {
this.process();
}
},
@ -176,7 +188,7 @@ SettingsLock.prototype = {
if (this._settingsManager.hasReadPrivileges) {
let req = Services.DOMRequest.createRequest(this._settingsManager._window);
this._requests.enqueue({ request: req, intent:"get", name: aName });
this.createTransactionAndProcess();
this.maybeProcess();
return req;
} else {
if (DEBUG) debug("get not allowed");
@ -221,7 +233,7 @@ SettingsLock.prototype = {
if (DEBUG) debug("send: " + JSON.stringify(aSettings));
let settings = this._serializePreservingBinaries(aSettings);
this._requests.enqueue({request: req, intent: "set", settings: settings});
this.createTransactionAndProcess();
this.maybeProcess();
return req;
} else {
if (DEBUG) debug("set not allowed");
@ -237,7 +249,7 @@ SettingsLock.prototype = {
if (this._settingsManager.hasWritePrivileges) {
let req = Services.DOMRequest.createRequest(this._settingsManager._window);
this._requests.enqueue({ request: req, intent: "clear"});
this.createTransactionAndProcess();
this.maybeProcess();
return req;
} else {
if (DEBUG) debug("clear not allowed");
@ -251,7 +263,6 @@ SettingsLock.prototype = {
};
function SettingsManager() {
this._locks = new Queue();
this._settingsDB = new SettingsDB();
this._settingsDB.init();
}
@ -263,13 +274,6 @@ SettingsManager.prototype = {
return Cu.cloneInto(obj, this._window);
},
nextTick: function nextTick(aCallback, thisObj) {
if (thisObj)
aCallback = aCallback.bind(thisObj);
Services.tm.currentThread.dispatch(aCallback, Ci.nsIThread.DISPATCH_NORMAL);
},
set onsettingchange(aHandler) {
this.__DOM_IMPL__.setEventHandler("onsettingchange", aHandler);
},
@ -281,12 +285,10 @@ SettingsManager.prototype = {
createLock: function() {
if (DEBUG) debug("get lock!");
var lock = new SettingsLock(this);
this._locks.enqueue(lock);
this._settingsDB.ensureDB(
function() { lock.createTransactionAndProcess(); },
function() { dump("Cannot open Settings DB. Trying to open an old version?\n"); }
);
this.nextTick(function() { this._open = false; }, lock);
return lock;
},

Просмотреть файл

@ -213,18 +213,10 @@ TelephonyProvider.prototype = {
* Track the active call and update the audio system as its state changes.
*/
_activeCall: null,
_updateCallAudioState: function(aCall, aConferenceState) {
_updateActiveCall: function(aCall, aConferenceState) {
if (aConferenceState === nsITelephonyProvider.CALL_STATE_CONNECTED) {
this._activeCall = new ConferenceCall(aConferenceState);
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_IN_CALL;
if (this.speakerEnabled) {
gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION,
nsIAudioManager.FORCE_SPEAKER);
}
if (DEBUG) {
debug("Active call, put audio system into PHONE_STATE_IN_CALL: " +
gAudioManager.phoneState);
}
this._updateCallAudioState(aCall);
return;
}
@ -232,11 +224,7 @@ TelephonyProvider.prototype = {
aConferenceState === nsITelephonyProvider.CALL_STATE_HELD) {
if (this._activeCall instanceof ConferenceCall) {
this._activeCall = null;
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_NORMAL;
if (DEBUG) {
debug("No active call, put audio system into PHONE_STATE_NORMAL: " +
gAudioManager.phoneState);
}
this._updateCallAudioState(aCall);
}
return;
}
@ -258,28 +246,12 @@ TelephonyProvider.prototype = {
case nsITelephonyProvider.CALL_STATE_CONNECTED:
aCall.isActive = true;
this._activeCall = new SingleCall(aCall);
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_IN_CALL;
if (this.speakerEnabled) {
gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION,
nsIAudioManager.FORCE_SPEAKER);
}
if (DEBUG) {
debug("Active call, put audio system into PHONE_STATE_IN_CALL: " +
gAudioManager.phoneState);
}
this._updateCallAudioState(aCall);
break;
case nsITelephonyProvider.CALL_STATE_INCOMING:
aCall.isActive = false;
if (!this._activeCall) {
// We can change the phone state into RINGTONE only when there's
// no active call.
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_RINGTONE;
if (DEBUG) {
debug("Incoming call, put audio system into PHONE_STATE_RINGTONE: " +
gAudioManager.phoneState);
}
}
this._updateCallAudioState(aCall);
break;
case nsITelephonyProvider.CALL_STATE_HELD: // Fall through...
@ -288,20 +260,49 @@ TelephonyProvider.prototype = {
if (this._matchActiveSingleCall(aCall)) {
// Previously active call is not active now.
this._activeCall = null;
}
if (!this._activeCall) {
// No active call. Disable the audio.
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_NORMAL;
if (DEBUG) {
debug("No active call, put audio system into PHONE_STATE_NORMAL: " +
gAudioManager.phoneState);
}
this._updateCallAudioState(aCall);
}
break;
}
},
_updateCallAudioState: function(aCall) {
// Ignore audio state setting if the call is a placeholder.
if (aCall && aCall.callIndex === OUTGOING_PLACEHOLDER_CALL_INDEX) {
return;
}
let active = (this._activeCall !== null);
let incoming = (aCall &&
aCall.state === nsITelephonyProvider.CALL_STATE_INCOMING);
if (active) {
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_IN_CALL;
if (this.speakerEnabled) {
gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION,
nsIAudioManager.FORCE_SPEAKER);
}
if (DEBUG) {
debug("Active call, put audio system into PHONE_STATE_IN_CALL: " +
gAudioManager.phoneState);
}
} else if (incoming) {
// We can change the phone state into RINGTONE only when there's
// no active call.
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_RINGTONE;
if (DEBUG) {
debug("Incoming call, put audio system into PHONE_STATE_RINGTONE: " +
gAudioManager.phoneState);
}
} else {
gAudioManager.phoneState = nsIAudioManager.PHONE_STATE_NORMAL;
if (DEBUG) {
debug("No active call, put audio system into PHONE_STATE_NORMAL: " +
gAudioManager.phoneState);
}
}
},
_convertRILCallState: function(aState) {
switch (aState) {
case RIL.CALL_STATE_UNKNOWN:
@ -747,7 +748,7 @@ TelephonyProvider.prototype = {
gSystemMessenger.broadcastMessage("telephony-call-ended", data);
aCall.clientId = aClientId;
this._updateCallAudioState(aCall, null);
this._updateActiveCall(aCall, null);
let manualConfStateChange = false;
let childId = this._currentCalls[aClientId][aCall.callIndex].childId;
@ -827,7 +828,7 @@ TelephonyProvider.prototype = {
}
aCall.clientId = aClientId;
this._updateCallAudioState(aCall, null);
this._updateActiveCall(aCall, null);
let call = this._currentCalls[aClientId][aCall.callIndex];
if (call) {
@ -891,7 +892,7 @@ TelephonyProvider.prototype = {
notifyConferenceCallStateChanged: function(aState) {
if (DEBUG) debug("handleConferenceCallStateChanged: " + aState);
aState = this._convertRILCallState(aState);
this._updateCallAudioState(null, aState);
this._updateActiveCall(null, aState);
this._notifyAllListeners("conferenceCallStateChanged", [aState]);
},

Просмотреть файл

@ -246,6 +246,14 @@ interface MozWifiManager : EventTarget {
*/
DOMRequest getImportedCerts();
/**
* Delete an imported certificate.
* @param certNickname Nickname of imported to be deleted.
* onsuccess: We have successfully deleted certificate.
* onerror: We have failed to delete certificate.
*/
DOMRequest deleteCert(DOMString certNickname);
/**
* Returns whether or not wifi is currently enabled.
*/

Просмотреть файл

@ -96,6 +96,7 @@ DOMWifiManager.prototype = {
"WifiManager:setStaticIpMode:Return:OK", "WifiManager:setStaticIpMode:Return:NO",
"WifiManager:importCert:Return:OK", "WifiManager:importCert:Return:NO",
"WifiManager:getImportedCerts:Return:OK", "WifiManager:getImportedCerts:Return:NO",
"WifiManager:deleteCert:Return:OK", "WifiManager:deleteCert:Return:NO",
"WifiManager:wifiDown", "WifiManager:wifiUp",
"WifiManager:onconnecting", "WifiManager:onassociate",
"WifiManager:onconnect", "WifiManager:ondisconnect",
@ -288,6 +289,14 @@ DOMWifiManager.prototype = {
Services.DOMRequest.fireError(request, msg.data);
break;
case "WifiManager:deleteCert:Return:OK":
Services.DOMRequest.fireSuccess(request, msg.data);
break;
case "WifiManager:deleteCert:Return:NO":
Services.DOMRequest.fireError(request, msg.data);
break;
case "WifiManager:wifiDown":
this._enabled = false;
this._currentNetwork = null;
@ -452,6 +461,15 @@ DOMWifiManager.prototype = {
return request;
},
deleteCert: function nsIDOMWifiManager_deleteCert(certNickname) {
var request = this.createRequest();
this._sendMessageForRequest("WifiManager:deleteCert",
{
certNickname: certNickname
}, request);
return request;
},
get enabled() {
return this._enabled;
},

Просмотреть файл

@ -163,6 +163,59 @@ private:
WifiCertServiceResultOptions mResult;
};
class DeleteCertTask MOZ_FINAL: public CryptoTask
{
public:
DeleteCertTask(int32_t aId, const nsAString& aCertNickname)
{
MOZ_ASSERT(NS_IsMainThread());
mResult.mId = aId;
mResult.mStatus = 0;
mResult.mUsageFlag = 0;
mResult.mNickname = aCertNickname;
}
private:
virtual void ReleaseNSSResources() {}
virtual nsresult CalculateResult() MOZ_OVERRIDE
{
MOZ_ASSERT(!NS_IsMainThread());
nsCString userNickname;
CopyUTF16toUTF8(mResult.mNickname, userNickname);
// Delete server certificate.
nsCString serverCertName("WIFI_SERVERCERT_", 16);
serverCertName += userNickname;
ScopedCERTCertificate cert(
CERT_FindCertByNickname(CERT_GetDefaultCertDB(), serverCertName.get())
);
if (!cert) {
return MapSECStatus(SECFailure);
}
SECStatus srv = SEC_DeletePermCertificate(cert);
if (srv != SECSuccess) {
return MapSECStatus(srv);
}
return NS_OK;
}
virtual void CallCallback(nsresult rv)
{
if (NS_FAILED(rv)) {
mResult.mStatus = -1;
}
gWifiCertService->DispatchResult(mResult);
}
WifiCertServiceResultOptions mResult;
};
NS_IMPL_ISUPPORTS(WifiCertService, nsIWifiCertService)
NS_IMETHODIMP
@ -249,6 +302,13 @@ WifiCertService::ImportCert(int32_t aId, nsIDOMBlob* aCertBlob,
return task->Dispatch("WifiImportCert");
}
NS_IMETHODIMP
WifiCertService::DeleteCert(int32_t aId, const nsAString& aCertNickname)
{
RefPtr<CryptoTask> task = new DeleteCertTask(aId, aCertNickname);
return task->Dispatch("WifiDeleteCert");
}
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WifiCertService,
WifiCertService::FactoryCreate)

Просмотреть файл

@ -1379,6 +1379,15 @@ var WifiManager = (function() {
caInfo.certNickname);
}
manager.deleteCert = function(caInfo, callback) {
var id = idgen++;
if (callback) {
controlCallbacks[id] = callback;
}
wifiCertService.deleteCert(id, caInfo.certNickname);
}
return manager;
})();
@ -1647,6 +1656,7 @@ function WifiWorker() {
"WifiManager:setStaticIpMode",
"WifiManager:importCert",
"WifiManager:getImportedCerts",
"WifiManager:deleteCert",
"child-process-shutdown"];
messages.forEach((function(msgName) {
@ -2605,6 +2615,9 @@ WifiWorker.prototype = {
case "WifiManager:getImportedCerts":
this.getImportedCerts(msg);
break;
case "WifiManager:deleteCert":
this.deleteCert(msg);
break;
case "WifiManager:getState": {
let i;
if ((i = this._domManagers.indexOf(msg.manager)) === -1) {
@ -3157,6 +3170,15 @@ WifiWorker.prototype = {
self._sendMessage(message, true, importedCerts, msg);
},
deleteCert: function deleteCert(msg) {
const message = "WifiManager:deleteCert:Return";
let self = this;
WifiManager.deleteCert(msg.data, function(data) {
self._sendMessage(message, data.status === 0, "Delete Cert failed", msg);
});
},
// This is a bit ugly, but works. In particular, this depends on the fact
// that RadioManager never actually tries to get the worker from us.
get worker() { throw "Not implemented"; },

Просмотреть файл

@ -7,7 +7,7 @@
interface nsIDOMBlob;
interface nsIWifiEventListener;
[scriptable, uuid(49e8e04e-eb05-4c92-84a6-7af32310f0c3)]
[scriptable, uuid(2712a791-f720-484d-8820-c4085629f657)]
interface nsIWifiCertService : nsISupports
{
const unsigned short WIFI_CERT_USAGE_FLAG_SERVER = 0x01;
@ -32,4 +32,15 @@ interface nsIWifiCertService : nsISupports
in nsIDOMBlob certBlob,
in DOMString certPassword,
in DOMString certNickname);
/**
* Delete an imported certificate file
*
* @param id
* Request ID.
* @param certNickname
* Certificate nickname to delete.
*/
void deleteCert(in long id,
in DOMString certNickname);
};