mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge latest green inbound changeset and mozilla-central; a=merge
This commit is contained in:
commit
3f06054776
@ -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="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -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="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8ba14125aba912707f44761f194339e6e59701b7"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -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="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8ba14125aba912707f44761f194339e6e59701b7"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "dcb55fbcaa9bd33e662a2c5e99cdb7e4c9d7ad51",
|
||||
"revision": "387f4c0123a7e82eae4c83f88f73e81f907c00e2",
|
||||
"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="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -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="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -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="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8ba14125aba912707f44761f194339e6e59701b7"/>
|
||||
|
@ -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="ccd70903544486bea04e85d8a4aacf63f1de2a72"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd5065ced020014df5fd45259fba1ac32d65673b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="44b04243e31cd16f3baf54fcd4b5fecf9deb8b94"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -83,9 +83,11 @@ DOMRequestIpcHelper.prototype = {
|
||||
aMessages.forEach((aMsg) => {
|
||||
let name = aMsg.name || aMsg;
|
||||
// If the listener is already set and it is of the same type we just
|
||||
// bail out. If it is not of the same type, we throw an exception.
|
||||
// increase the count and bail out. If it is not of the same type,
|
||||
// we throw an exception.
|
||||
if (this._listeners[name] != undefined) {
|
||||
if (!!aMsg.weakRef == this._listeners[name]) {
|
||||
if (!!aMsg.weakRef == this._listeners[name].weakRef) {
|
||||
this._listeners[name].count++;
|
||||
return;
|
||||
} else {
|
||||
throw Cr.NS_ERROR_FAILURE;
|
||||
@ -94,7 +96,10 @@ DOMRequestIpcHelper.prototype = {
|
||||
|
||||
aMsg.weakRef ? cpmm.addWeakMessageListener(name, this)
|
||||
: cpmm.addMessageListener(name, this);
|
||||
this._listeners[name] = !!aMsg.weakRef;
|
||||
this._listeners[name] = {
|
||||
weakRef: !!aMsg.weakRef,
|
||||
count: 1
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
@ -116,9 +121,14 @@ DOMRequestIpcHelper.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
this._listeners[aName] ? cpmm.removeWeakMessageListener(aName, this)
|
||||
: cpmm.removeMessageListener(aName, this);
|
||||
delete this._listeners[aName];
|
||||
// Only remove the listener really when we don't have anybody that could
|
||||
// be waiting on a message.
|
||||
if (!--this._listeners[aName].count) {
|
||||
this._listeners[aName].weakRef ?
|
||||
cpmm.removeWeakMessageListener(aName, this)
|
||||
: cpmm.removeMessageListener(aName, this);
|
||||
delete this._listeners[aName];
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -66,20 +66,22 @@
|
||||
* Message listeners.
|
||||
*/
|
||||
function checkMessageListeners(aExpectedListeners, aCount) {
|
||||
ok(true, "Checking message listeners\n" + "Expected listeners " +
|
||||
JSON.stringify(aExpectedListeners) + " \nExpected count " + aCount);
|
||||
info("Checking message listeners\n" + "Expected listeners " +
|
||||
JSON.stringify(aExpectedListeners) + " \nExpected count " + aCount);
|
||||
let count = 0;
|
||||
Object.keys(dummy._listeners).forEach(function(name) {
|
||||
count++;
|
||||
is(aExpectedListeners[name], dummy._listeners[name],
|
||||
"Message found " + name + " - Same listeners");
|
||||
is(aExpectedListeners[name].weakRef, dummy._listeners[name].weakRef,
|
||||
"Message found " + name + " - Same weakRef");
|
||||
is(aExpectedListeners[name].count, dummy._listeners[name].count,
|
||||
"Message found " + name + " - Same count");
|
||||
});
|
||||
is(aCount, count, "Correct number of listeners");
|
||||
}
|
||||
|
||||
function addMessageListenersTest(aMessages, aExpectedListeners, aCount) {
|
||||
dummy.addMessageListeners(aMessages);
|
||||
ok(true, JSON.stringify(dummy._listeners));
|
||||
info(JSON.stringify(dummy._listeners));
|
||||
checkMessageListeners(aExpectedListeners, aCount);
|
||||
}
|
||||
|
||||
@ -165,39 +167,40 @@
|
||||
*/
|
||||
var tests = [
|
||||
function() {
|
||||
ok(true, "== InitDOMRequestHelper no messages");
|
||||
info("== InitDOMRequestHelper no messages");
|
||||
initDOMRequestHelperTest(null);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== DestroyDOMRequestHelper");
|
||||
info("== DestroyDOMRequestHelper");
|
||||
destroyDOMRequestHelperTest();
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== InitDOMRequestHelper empty array");
|
||||
info("== InitDOMRequestHelper empty array");
|
||||
initDOMRequestHelperTest([]);
|
||||
checkMessageListeners({}, 0);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== DestroyDOMRequestHelper");
|
||||
info("== DestroyDOMRequestHelper");
|
||||
destroyDOMRequestHelperTest();
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== InitDOMRequestHelper with strings array");
|
||||
info("== InitDOMRequestHelper with strings array");
|
||||
initDOMRequestHelperTest(["name1", "nameN"]);
|
||||
checkMessageListeners({"name1": false, "nameN": false}, 2);
|
||||
checkMessageListeners({"name1": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: false, count: 1}}, 2);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== DestroyDOMRequestHelper");
|
||||
info("== DestroyDOMRequestHelper");
|
||||
destroyDOMRequestHelperTest();
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== InitDOMRequestHelper with objects array");
|
||||
info("== InitDOMRequestHelper with objects array");
|
||||
initDOMRequestHelperTest([{
|
||||
name: "name1",
|
||||
weakRef: false
|
||||
@ -205,41 +208,50 @@
|
||||
name: "nameN",
|
||||
weakRef: true
|
||||
}]);
|
||||
checkMessageListeners({"name1": false, "nameN": true}, 2);
|
||||
checkMessageListeners({
|
||||
"name1": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 2);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== AddMessageListeners empty array");
|
||||
addMessageListenersTest([], {"name1": false, "nameN": true}, 2);
|
||||
info("== AddMessageListeners empty array");
|
||||
addMessageListenersTest([], {
|
||||
"name1": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 2);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== AddMessageListeners null");
|
||||
addMessageListenersTest(null, {"name1": false, "nameN": true}, 2);
|
||||
info("== AddMessageListeners null");
|
||||
addMessageListenersTest(null, {
|
||||
"name1": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 2);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== AddMessageListeners new listener, string only");
|
||||
info("== AddMessageListeners new listener, string only");
|
||||
addMessageListenersTest("name2", {
|
||||
"name1": false,
|
||||
"name2": false,
|
||||
"nameN": true
|
||||
"name1": {weakRef: false, count: 1},
|
||||
"name2": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 3);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== AddMessageListeners new listeners, strings array");
|
||||
info("== AddMessageListeners new listeners, strings array");
|
||||
addMessageListenersTest(["name3", "name4"], {
|
||||
"name1": false,
|
||||
"name2": false,
|
||||
"name3": false,
|
||||
"name4": false,
|
||||
"nameN": true
|
||||
"name1": {weakRef: false, count: 1},
|
||||
"name2": {weakRef: false, count: 1},
|
||||
"name3": {weakRef: false, count: 1},
|
||||
"name4": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 5);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== AddMessageListeners new listeners, objects array");
|
||||
info("== AddMessageListeners new listeners, objects array");
|
||||
addMessageListenersTest([{
|
||||
name: "name5",
|
||||
weakRef: true
|
||||
@ -247,69 +259,69 @@
|
||||
name: "name6",
|
||||
weakRef: false
|
||||
}], {
|
||||
"name1": false,
|
||||
"name2": false,
|
||||
"name3": false,
|
||||
"name4": false,
|
||||
"name5": true,
|
||||
"name6": false,
|
||||
"nameN": true
|
||||
"name1": {weakRef: false, count: 1},
|
||||
"name2": {weakRef: false, count: 1},
|
||||
"name3": {weakRef: false, count: 1},
|
||||
"name4": {weakRef: false, count: 1},
|
||||
"name5": {weakRef: true, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 7);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== RemoveMessageListeners, null");
|
||||
info("== RemoveMessageListeners, null");
|
||||
removeMessageListenersTest(null, {
|
||||
"name1": false,
|
||||
"name2": false,
|
||||
"name3": false,
|
||||
"name4": false,
|
||||
"name5": true,
|
||||
"name6": false,
|
||||
"nameN": true
|
||||
"name1": {weakRef: false, count: 1},
|
||||
"name2": {weakRef: false, count: 1},
|
||||
"name3": {weakRef: false, count: 1},
|
||||
"name4": {weakRef: false, count: 1},
|
||||
"name5": {weakRef: true, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 7);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== RemoveMessageListeners, one message");
|
||||
info("== RemoveMessageListeners, one message");
|
||||
removeMessageListenersTest("name1", {
|
||||
"name2": false,
|
||||
"name3": false,
|
||||
"name4": false,
|
||||
"name5": true,
|
||||
"name6": false,
|
||||
"nameN": true
|
||||
"name2": {weakRef: false, count: 1},
|
||||
"name3": {weakRef: false, count: 1},
|
||||
"name4": {weakRef: false, count: 1},
|
||||
"name5": {weakRef: true, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 6);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== RemoveMessageListeners, array of messages");
|
||||
info("== RemoveMessageListeners, array of messages");
|
||||
removeMessageListenersTest(["name2", "name3"], {
|
||||
"name4": false,
|
||||
"name5": true,
|
||||
"name6": false,
|
||||
"nameN": true
|
||||
"name4": {weakRef: false, count: 1},
|
||||
"name5": {weakRef: true, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 4);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== RemoveMessageListeners, unknown message");
|
||||
info("== RemoveMessageListeners, unknown message");
|
||||
removeMessageListenersTest("unknown", {
|
||||
"name4": false,
|
||||
"name5": true,
|
||||
"name6": false,
|
||||
"nameN": true
|
||||
"name4": {weakRef: false, count: 1},
|
||||
"name5": {weakRef: true, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 4);
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
try {
|
||||
ok(true, "== AddMessageListeners, same message, same kind");
|
||||
info("== AddMessageListeners, same message, same kind");
|
||||
addMessageListenersTest("name4", {
|
||||
"name4": false,
|
||||
"name5": true,
|
||||
"name6": false,
|
||||
"nameN": true
|
||||
"name4": {weakRef: false, count: 2},
|
||||
"name5": {weakRef: true, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 4);
|
||||
next();
|
||||
} catch (ex) {
|
||||
@ -317,13 +329,13 @@
|
||||
}
|
||||
},
|
||||
function() {
|
||||
ok(true, "== AddMessageListeners, same message, different kind");
|
||||
info("== AddMessageListeners, same message, different kind");
|
||||
try {
|
||||
addMessageListenersTest({name: "name4", weakRef: true}, {
|
||||
"name4": true,
|
||||
"name5": true,
|
||||
"name6": false,
|
||||
"nameN": true
|
||||
"name4": {weakRef: false, count: 2},
|
||||
"name5": {weakRef: true, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 4);
|
||||
ok(false, "Should have thrown an exception");
|
||||
} catch (ex) {
|
||||
@ -332,14 +344,27 @@
|
||||
}
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test createRequest()");
|
||||
info("== RemoveMessageListeners, message with two listeners");
|
||||
try {
|
||||
removeMessageListenersTest(["name4", "name5"], {
|
||||
"name4": {weakRef: false, count: 1},
|
||||
"name6": {weakRef: false, count: 1},
|
||||
"nameN": {weakRef: true, count: 1}
|
||||
}, 3);
|
||||
next();
|
||||
} catch (ex) {
|
||||
ok(false, "Unexpected exception " + ex);
|
||||
}
|
||||
},
|
||||
function() {
|
||||
info("== Test createRequest()");
|
||||
ok(DOMRequest, "DOMRequest object exists");
|
||||
var req = dummy.createRequest();
|
||||
ok(req instanceof DOMRequest, "Returned a DOMRequest");
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test getRequestId(), removeRequest() and getRequest()");
|
||||
info("== Test getRequestId(), removeRequest() and getRequest()");
|
||||
var req = dummy.createRequest();
|
||||
var id = dummy.getRequestId(req);
|
||||
is(typeof id, "string", "id is a string");
|
||||
@ -351,7 +376,7 @@
|
||||
next();
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test createPromise()");
|
||||
info("== Test createPromise()");
|
||||
ok(Promise, "Promise object exists");
|
||||
var promise = dummy.createPromise(function(resolve, reject) {
|
||||
resolve(true);
|
||||
@ -360,7 +385,7 @@
|
||||
promise.then(next);
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test getResolver()");
|
||||
info("== Test getResolver()");
|
||||
var id;
|
||||
var resolver;
|
||||
var promise = dummy.createPromise(function(resolve, reject) {
|
||||
@ -376,7 +401,7 @@
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test removeResolver");
|
||||
info("== Test removeResolver");
|
||||
var id;
|
||||
var promise = dummy.createPromise(function(resolve, reject) {
|
||||
var r = { resolve: resolve, reject: reject };
|
||||
@ -384,7 +409,7 @@
|
||||
ok(typeof id === "string", "id is a string");
|
||||
|
||||
var resolver = dummy.getPromiseResolver(id);
|
||||
ok(true, "Got resolver " + JSON.stringify(resolver));
|
||||
info("Got resolver " + JSON.stringify(resolver));
|
||||
ok(resolver === r, "Resolver get succeeded");
|
||||
|
||||
r.resolve(true);
|
||||
@ -396,7 +421,7 @@
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test takeResolver");
|
||||
info("== Test takeResolver");
|
||||
var id;
|
||||
var resolver;
|
||||
var promise = dummy.createPromise(function(resolve, reject) {
|
||||
@ -419,21 +444,21 @@
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test window destroyed without messages and without GC");
|
||||
info("== Test window destroyed without messages and without GC");
|
||||
checkWindowDestruction({ gc: false }, function(uninitCalled) {
|
||||
ok(uninitCalled, "uninit() should have been called");
|
||||
next();
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test window destroyed without messages and with GC");
|
||||
info("== Test window destroyed without messages and with GC");
|
||||
checkWindowDestruction({ gc: true }, function(uninitCalled) {
|
||||
ok(!uninitCalled, "uninit() should NOT have been called");
|
||||
next();
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test window destroyed with weak messages and without GC");
|
||||
info("== Test window destroyed with weak messages and without GC");
|
||||
checkWindowDestruction({ messages: [{ name: "foo", weakRef: true }],
|
||||
gc: false }, function(uninitCalled) {
|
||||
ok(uninitCalled, "uninit() should have been called");
|
||||
@ -441,7 +466,7 @@
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test window destroyed with weak messages and with GC");
|
||||
info("== Test window destroyed with weak messages and with GC");
|
||||
checkWindowDestruction({ messages: [{ name: "foo", weakRef: true }],
|
||||
gc: true }, function(uninitCalled) {
|
||||
ok(!uninitCalled, "uninit() should NOT have been called");
|
||||
@ -449,7 +474,7 @@
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test window destroyed with strong messages and without GC");
|
||||
info("== Test window destroyed with strong messages and without GC");
|
||||
checkWindowDestruction({ messages: [{ name: "foo", weakRef: false }],
|
||||
gc: false }, function(uninitCalled) {
|
||||
ok(uninitCalled, "uninit() should have been called");
|
||||
@ -457,7 +482,7 @@
|
||||
});
|
||||
},
|
||||
function() {
|
||||
ok(true, "== Test window destroyed with strong messages and with GC");
|
||||
info("== Test window destroyed with strong messages and with GC");
|
||||
checkWindowDestruction({ messages: [{ name: "foo", weakRef: false }],
|
||||
gc: true }, function(uninitCalled) {
|
||||
ok(uninitCalled, "uninit() should have been called");
|
||||
|
@ -181,6 +181,9 @@ TelephonyListener::CallStateChanged(uint32_t aServiceId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -200,6 +203,9 @@ TelephonyListener::EnumerateCallState(uint32_t aServiceId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString_internal& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -270,7 +276,10 @@ TelephonyListener::NotifyConferenceError(const nsAString& aName,
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyListener::NotifyCdmaCallWaiting(uint32_t aServiceId,
|
||||
const nsAString& aNumber)
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation)
|
||||
{
|
||||
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
|
||||
NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
|
||||
|
@ -50,12 +50,12 @@ USING_BLUETOOTH_NAMESPACE
|
||||
static nsString sAdapterBdAddress;
|
||||
static nsString sAdapterBdName;
|
||||
static InfallibleTArray<nsString> sAdapterBondedAddressArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sChangeAdapterStateRunnableArray;
|
||||
|
||||
// Static variables below should only be used on *main thread*
|
||||
static const bt_interface_t* sBtInterface;
|
||||
static nsTArray<nsRefPtr<BluetoothProfileController> > sControllerArray;
|
||||
static nsTArray<int> sRequestedDeviceCountArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sChangeAdapterStateRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sChangeDiscoveryRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sSetPropertyRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sGetDeviceRunnableArray;
|
||||
@ -295,6 +295,27 @@ PlayStatusStringToControlPlayStatus(const nsAString& aPlayStatus)
|
||||
return playStatus;
|
||||
}
|
||||
|
||||
class AdapterStateChangedCallbackTask MOZ_FINAL : public nsRunnable
|
||||
{
|
||||
public:
|
||||
NS_IMETHOD
|
||||
Run()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
// Resolve promise if existed
|
||||
if (!sChangeAdapterStateRunnableArray.IsEmpty()) {
|
||||
BluetoothValue values(true);
|
||||
DispatchBluetoothReply(sChangeAdapterStateRunnableArray[0],
|
||||
values, EmptyString());
|
||||
|
||||
sChangeAdapterStateRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Bluedroid HAL callback functions
|
||||
*
|
||||
@ -327,13 +348,8 @@ AdapterStateChangeCallback(bt_state_t aStatus)
|
||||
return;
|
||||
}
|
||||
|
||||
// Resolve promise if existed
|
||||
if(!sChangeAdapterStateRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sChangeAdapterStateRunnableArray[0],
|
||||
BluetoothValue(true),
|
||||
EmptyString());
|
||||
sChangeAdapterStateRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
// Redirect to main thread to avoid racing problem
|
||||
NS_DispatchToMainThread(new AdapterStateChangedCallbackTask());
|
||||
}
|
||||
|
||||
class AdapterPropertiesCallbackTask MOZ_FINAL : public nsRunnable
|
||||
|
@ -670,12 +670,12 @@ BrowserElementParent.prototype = {
|
||||
if (aStatusCode == Cr.NS_OK) {
|
||||
// Everything looks great.
|
||||
debug('DownloadListener - Download Successful.');
|
||||
this.services.DOMRequest.fireSuccess(this.req, aStatusCode);
|
||||
Services.DOMRequest.fireSuccess(req, aStatusCode);
|
||||
}
|
||||
else {
|
||||
// In case of failure, we'll simply return the failure status code.
|
||||
debug('DownloadListener - Download Failed!');
|
||||
this.services.DOMRequest.fireError(this.req, aStatusCode);
|
||||
Services.DOMRequest.fireError(req, aStatusCode);
|
||||
}
|
||||
|
||||
if (this.extListener) {
|
||||
|
@ -59,30 +59,18 @@ function handleTechnologyDiscoveredRE0ForP2PRegFailure(msg) {
|
||||
}
|
||||
}
|
||||
|
||||
function activateRE(re) {
|
||||
let deferred = Promise.defer();
|
||||
let cmd = "nfc nci rf_intf_activated_ntf " + re;
|
||||
|
||||
emulator.run(cmd, function(result) {
|
||||
is(result.pop(), "OK", "check activation of RE" + re);
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function testPeerReady() {
|
||||
window.navigator.mozSetMessageHandler(
|
||||
"nfc-manager-tech-discovered", handleTechnologyDiscoveredRE0);
|
||||
|
||||
toggleNFC(true).then(() => activateRE(0));
|
||||
toggleNFC(true).then(() => emulator.activateRE(0));
|
||||
}
|
||||
|
||||
function testCheckP2PRegFailure() {
|
||||
window.navigator.mozSetMessageHandler(
|
||||
"nfc-manager-tech-discovered", handleTechnologyDiscoveredRE0ForP2PRegFailure);
|
||||
|
||||
toggleNFC(true).then(() => activateRE(0));
|
||||
toggleNFC(true).then(() => emulator.activateRE(0));
|
||||
}
|
||||
|
||||
function testCheckNfcPeerObjForInvalidToken() {
|
||||
|
@ -35,8 +35,8 @@ function testUrlTagDiscover(re) {
|
||||
});
|
||||
|
||||
toggleNFC(true)
|
||||
.then(() => setTagData(re, flag, tnf, btoa(type), btoa(payload)))
|
||||
.then(() => activateRE(re));
|
||||
.then(() => emulator.setTagData(re, flag, tnf, btoa(type), btoa(payload)))
|
||||
.then(() => emulator.activateRE(re));
|
||||
}
|
||||
|
||||
function testUrlT1TDiscover() {
|
||||
|
@ -2075,7 +2075,7 @@ RadioInterface.prototype = {
|
||||
gTelephonyService.notifyConferenceCallStateChanged(message.state);
|
||||
break;
|
||||
case "cdmaCallWaiting":
|
||||
gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.number);
|
||||
gTelephonyService.notifyCdmaCallWaiting(this.clientId, message.waitingCall);
|
||||
break;
|
||||
case "suppSvcNotification":
|
||||
gTelephonyService.notifySupplementaryService(this.clientId,
|
||||
|
@ -364,10 +364,24 @@ this.GECKO_CARD_TYPE = [
|
||||
"isim"
|
||||
];
|
||||
|
||||
this.NETWORK_STATE_UNKNOWN = "unknown";
|
||||
this.NETWORK_STATE_AVAILABLE = "available";
|
||||
this.NETWORK_STATE_CONNECTED = "connected";
|
||||
this.NETWORK_STATE_FORBIDDEN = "forbidden";
|
||||
|
||||
// Used for QUERY_AVAILABLE_NETWORKS status.
|
||||
this.QAN_STATE_UNKNOWN = "unknown";
|
||||
this.QAN_STATE_AVAILABLE = "available";
|
||||
this.QAN_STATE_CURRENT = "current";
|
||||
this.QAN_STATE_FORBIDDEN = "forbidden";
|
||||
|
||||
// Must be in sync with MobileNetworkState of MozMobileNetworkInfo.webidl
|
||||
this.GECKO_QAN_STATE_UNKNOWN = null;
|
||||
this.GECKO_QAN_STATE_AVAILABLE = "available";
|
||||
this.GECKO_QAN_STATE_CONNECTED = "connected";
|
||||
this.GECKO_QAN_STATE_FORBIDDEN = "forbidden";
|
||||
|
||||
this.RIL_QAN_STATE_TO_GECKO_STATE = {};
|
||||
this.RIL_QAN_STATE_TO_GECKO_STATE[this.QAN_STATE_UNKNOWN] = this.GECKO_QAN_STATE_UNKNOWN;
|
||||
this.RIL_QAN_STATE_TO_GECKO_STATE[this.QAN_STATE_AVAILABLE] = this.GECKO_QAN_STATE_AVAILABLE;
|
||||
this.RIL_QAN_STATE_TO_GECKO_STATE[this.QAN_STATE_CURRENT] = this.GECKO_QAN_STATE_CONNECTED;
|
||||
this.RIL_QAN_STATE_TO_GECKO_STATE[this.QAN_STATE_FORBIDDEN] = this.GECKO_QAN_STATE_FORBIDDEN;
|
||||
|
||||
this.NETWORK_SELECTION_MODE_AUTOMATIC = 0;
|
||||
this.NETWORK_SELECTION_MODE_MANUAL = 1;
|
||||
@ -2395,9 +2409,6 @@ this.GECKO_NETWORK_STATE_CONNECTED = 1;
|
||||
this.GECKO_NETWORK_STATE_DISCONNECTING = 2;
|
||||
this.GECKO_NETWORK_STATE_DISCONNECTED = 3;
|
||||
|
||||
// Used for QUERY_AVAILABLE_NETWORKS status of "unknown"
|
||||
this.GECKO_QAN_STATE_UNKNOWN = null;
|
||||
|
||||
this.CALL_FAIL_UNOBTAINABLE_NUMBER = 1;
|
||||
this.CALL_FAIL_NORMAL = 16;
|
||||
this.CALL_FAIL_BUSY = 17;
|
||||
|
@ -4461,13 +4461,8 @@ RilObject.prototype = {
|
||||
}
|
||||
|
||||
let state = strings[i + 3];
|
||||
if (state === NETWORK_STATE_UNKNOWN) {
|
||||
// TODO: looks like this might conflict in style with
|
||||
// GECKO_NETWORK_STYLE_UNKNOWN / nsINetworkManager
|
||||
state = GECKO_QAN_STATE_UNKNOWN;
|
||||
}
|
||||
network.state = RIL_QAN_STATE_TO_GECKO_STATE[state];
|
||||
|
||||
network.state = state;
|
||||
networks.push(network);
|
||||
}
|
||||
return networks;
|
||||
@ -5529,7 +5524,7 @@ RilObject.prototype[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CA
|
||||
if (RILQUIRKS_CALLSTATE_EXTRA_UINT32) {
|
||||
Buf.readInt32();
|
||||
}
|
||||
call.number = Buf.readString(); //TODO munge with TOA
|
||||
call.number = Buf.readString();
|
||||
call.numberPresentation = Buf.readInt32(); // CALL_PRESENTATION_*
|
||||
call.name = Buf.readString();
|
||||
call.namePresentation = Buf.readInt32();
|
||||
@ -6860,7 +6855,7 @@ RilObject.prototype[UNSOLICITED_CDMA_CALL_WAITING] = function UNSOLICITED_CDMA_C
|
||||
call.alertPitch = Buf.readInt32();
|
||||
call.signal = Buf.readInt32();
|
||||
this.sendChromeMessage({rilMessageType: "cdmaCallWaiting",
|
||||
number: call.number});
|
||||
waitingCall: call});
|
||||
};
|
||||
RilObject.prototype[UNSOLICITED_CDMA_OTA_PROVISION_STATUS] = function UNSOLICITED_CDMA_OTA_PROVISION_STATUS() {
|
||||
let status = this.context.Buf.readInt32List()[0];
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "CallsList.h"
|
||||
#include "TelephonyCall.h"
|
||||
#include "TelephonyCallGroup.h"
|
||||
#include "TelephonyCallId.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
using mozilla::ErrorResult;
|
||||
@ -276,6 +277,9 @@ Telephony::CreateNewDialingCall(uint32_t aServiceId, const nsAString& aNumber,
|
||||
{
|
||||
nsRefPtr<TelephonyCall> call =
|
||||
TelephonyCall::Create(this, aServiceId, aNumber,
|
||||
nsITelephonyService::CALL_PRESENTATION_ALLOWED,
|
||||
EmptyString(),
|
||||
nsITelephonyService::CALL_PRESENTATION_ALLOWED,
|
||||
nsITelephonyService::CALL_STATE_DIALING, aCallIndex);
|
||||
NS_ASSERTION(call, "This should never fail!");
|
||||
|
||||
@ -474,8 +478,10 @@ Telephony::EventListenerAdded(nsIAtom* aType)
|
||||
NS_IMETHODIMP
|
||||
Telephony::CallStateChanged(uint32_t aServiceId, uint32_t aCallIndex,
|
||||
uint16_t aCallState, const nsAString& aNumber,
|
||||
bool aIsOutgoing, bool aIsEmergency,
|
||||
bool aIsConference, bool aIsSwitchable, bool aIsMergeable)
|
||||
uint16_t aNumberPresentation, const nsAString& aName,
|
||||
uint16_t aNamePresentation, bool aIsOutgoing,
|
||||
bool aIsEmergency, bool aIsConference,
|
||||
bool aIsSwitchable, bool aIsMergeable)
|
||||
{
|
||||
nsRefPtr<TelephonyCall> modifiedCall
|
||||
= GetCallFromEverywhere(aServiceId, aCallIndex);
|
||||
@ -520,9 +526,10 @@ Telephony::CallStateChanged(uint32_t aServiceId, uint32_t aCallIndex,
|
||||
|
||||
// Didn't find this call in mCalls or mGroup. Create a new call.
|
||||
nsRefPtr<TelephonyCall> call =
|
||||
TelephonyCall::Create(this, aServiceId, aNumber, aCallState, aCallIndex,
|
||||
aIsEmergency, aIsConference, aIsSwitchable,
|
||||
aIsMergeable);
|
||||
TelephonyCall::Create(this, aServiceId, aNumber, aNumberPresentation,
|
||||
aName, aNamePresentation, aCallState, aCallIndex,
|
||||
aIsEmergency, aIsConference, aIsSwitchable,
|
||||
aIsMergeable);
|
||||
NS_ASSERTION(call, "This should never fail!");
|
||||
|
||||
NS_ASSERTION(aIsConference ? mGroup->CallsArray().Contains(call) :
|
||||
@ -564,8 +571,10 @@ Telephony::EnumerateCallStateComplete()
|
||||
NS_IMETHODIMP
|
||||
Telephony::EnumerateCallState(uint32_t aServiceId, uint32_t aCallIndex,
|
||||
uint16_t aCallState, const nsAString& aNumber,
|
||||
bool aIsOutgoing, bool aIsEmergency,
|
||||
bool aIsConference, bool aIsSwitchable, bool aIsMergeable)
|
||||
uint16_t aNumberPresentation, const nsAString& aName,
|
||||
uint16_t aNamePresentation, bool aIsOutgoing,
|
||||
bool aIsEmergency, bool aIsConference,
|
||||
bool aIsSwitchable, bool aIsMergeable)
|
||||
{
|
||||
nsRefPtr<TelephonyCall> call;
|
||||
|
||||
@ -580,7 +589,8 @@ Telephony::EnumerateCallState(uint32_t aServiceId, uint32_t aCallIndex,
|
||||
}
|
||||
|
||||
// Didn't know anything about this call before now.
|
||||
call = TelephonyCall::Create(this, aServiceId, aNumber, aCallState,
|
||||
call = TelephonyCall::Create(this, aServiceId, aNumber, aNumberPresentation,
|
||||
aName, aNamePresentation, aCallState,
|
||||
aCallIndex, aIsEmergency, aIsConference,
|
||||
aIsSwitchable, aIsMergeable);
|
||||
NS_ASSERTION(call, "This should never fail!");
|
||||
@ -642,14 +652,20 @@ Telephony::NotifyError(uint32_t aServiceId,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
Telephony::NotifyCdmaCallWaiting(uint32_t aServiceId, const nsAString& aNumber)
|
||||
Telephony::NotifyCdmaCallWaiting(uint32_t aServiceId, const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation)
|
||||
{
|
||||
MOZ_ASSERT(mCalls.Length() == 1);
|
||||
|
||||
nsRefPtr<TelephonyCall> callToNotify = mCalls[0];
|
||||
MOZ_ASSERT(callToNotify && callToNotify->ServiceId() == aServiceId);
|
||||
|
||||
callToNotify->UpdateSecondNumber(aNumber);
|
||||
nsRefPtr<TelephonyCallId> id =
|
||||
new TelephonyCallId(GetOwner(), aNumber, aNumberPresentation, aName,
|
||||
aNamePresentation);
|
||||
callToNotify->UpdateSecondId(id);
|
||||
DispatchCallEvent(NS_LITERAL_STRING("callschanged"), callToNotify);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -19,25 +19,29 @@ using mozilla::ErrorResult;
|
||||
// static
|
||||
already_AddRefed<TelephonyCall>
|
||||
TelephonyCall::Create(Telephony* aTelephony, uint32_t aServiceId,
|
||||
const nsAString& aNumber, uint16_t aCallState,
|
||||
uint32_t aCallIndex, bool aEmergency, bool aIsConference,
|
||||
bool aSwitchable, bool aMergeable)
|
||||
const nsAString& aNumber, uint16_t aNumberPresentation,
|
||||
const nsAString& aName, uint16_t aNamePresentation,
|
||||
uint16_t aCallState, uint32_t aCallIndex, bool aEmergency,
|
||||
bool aIsConference, bool aSwitchable, bool aMergeable)
|
||||
{
|
||||
NS_ASSERTION(aTelephony, "Null pointer!");
|
||||
NS_ASSERTION(!aNumber.IsEmpty(), "Empty number!");
|
||||
NS_ASSERTION(aCallIndex >= 1, "Invalid call index!");
|
||||
|
||||
nsRefPtr<TelephonyCall> call = new TelephonyCall(aTelephony->GetOwner());
|
||||
nsRefPtr<TelephonyCallId> id = new TelephonyCallId(aTelephony->GetOwner(),
|
||||
aNumber, aNumberPresentation,
|
||||
aName, aNamePresentation);
|
||||
|
||||
call->mTelephony = aTelephony;
|
||||
call->mServiceId = aServiceId;
|
||||
call->mNumber = aNumber;
|
||||
call->mCallIndex = aCallIndex;
|
||||
call->mError = nullptr;
|
||||
call->mEmergency = aEmergency;
|
||||
call->mGroup = aIsConference ? aTelephony->ConferenceGroup() : nullptr;
|
||||
call->mSwitchable = aSwitchable;
|
||||
call->mMergeable = aMergeable;
|
||||
call->mId = id;
|
||||
|
||||
call->ChangeStateInternal(aCallState, false);
|
||||
|
||||
@ -187,7 +191,9 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(TelephonyCall,
|
||||
DOMEventTargetHelper,
|
||||
mTelephony,
|
||||
mError,
|
||||
mGroup);
|
||||
mGroup,
|
||||
mId,
|
||||
mSecondId);
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TelephonyCall)
|
||||
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
|
||||
@ -197,6 +203,20 @@ NS_IMPL_RELEASE_INHERITED(TelephonyCall, DOMEventTargetHelper)
|
||||
|
||||
// TelephonyCall WebIDL
|
||||
|
||||
already_AddRefed<TelephonyCallId>
|
||||
TelephonyCall::Id() const
|
||||
{
|
||||
nsRefPtr<TelephonyCallId> id = mId;
|
||||
return id.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<TelephonyCallId>
|
||||
TelephonyCall::GetSecondId() const
|
||||
{
|
||||
nsRefPtr<TelephonyCallId> id = mSecondId;
|
||||
return id.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<DOMError>
|
||||
TelephonyCall::GetError() const
|
||||
{
|
||||
@ -272,7 +292,7 @@ TelephonyCall::Hold(ErrorResult& aRv)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mSecondNumber.IsEmpty()) {
|
||||
if (mSecondId) {
|
||||
// No state transition when we switch two numbers within one TelephonyCall
|
||||
// object. Otherwise, the state here will be inconsistent with the backend
|
||||
// RIL and will never be right.
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
#include "mozilla/dom/DOMError.h"
|
||||
|
||||
#include "TelephonyCallId.h"
|
||||
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
@ -21,9 +23,10 @@ class TelephonyCall MOZ_FINAL : public DOMEventTargetHelper
|
||||
nsRefPtr<Telephony> mTelephony;
|
||||
nsRefPtr<TelephonyCallGroup> mGroup;
|
||||
|
||||
nsRefPtr<TelephonyCallId> mId;
|
||||
nsRefPtr<TelephonyCallId> mSecondId;
|
||||
|
||||
uint32_t mServiceId;
|
||||
nsString mNumber;
|
||||
nsString mSecondNumber;
|
||||
nsString mState;
|
||||
bool mEmergency;
|
||||
nsRefPtr<DOMError> mError;
|
||||
@ -39,7 +42,6 @@ public:
|
||||
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCall,
|
||||
DOMEventTargetHelper)
|
||||
|
||||
friend class Telephony;
|
||||
|
||||
nsPIDOMWindow*
|
||||
@ -53,17 +55,11 @@ public:
|
||||
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||
|
||||
// WebIDL
|
||||
void
|
||||
GetNumber(nsString& aNumber) const
|
||||
{
|
||||
aNumber.Assign(mNumber);
|
||||
}
|
||||
already_AddRefed<TelephonyCallId>
|
||||
Id() const;
|
||||
|
||||
void
|
||||
GetSecondNumber(nsString& aSecondNumber) const
|
||||
{
|
||||
aSecondNumber.Assign(mSecondNumber);
|
||||
}
|
||||
already_AddRefed<TelephonyCallId>
|
||||
GetSecondId() const;
|
||||
|
||||
void
|
||||
GetState(nsString& aState) const
|
||||
@ -122,7 +118,9 @@ public:
|
||||
|
||||
static already_AddRefed<TelephonyCall>
|
||||
Create(Telephony* aTelephony, uint32_t aServiceId,
|
||||
const nsAString& aNumber, uint16_t aCallState, uint32_t aCallIndex,
|
||||
const nsAString& aNumber, uint16_t aNumberPresentation,
|
||||
const nsAString& aName, uint16_t aNamePresentation,
|
||||
uint16_t aCallState, uint32_t aCallIndex,
|
||||
bool aEmergency = false, bool aIsConference = false,
|
||||
bool aSwitchable = true, bool aMergeable = true);
|
||||
|
||||
@ -156,12 +154,6 @@ public:
|
||||
mEmergency = aEmergency;
|
||||
}
|
||||
|
||||
void
|
||||
UpdateSecondNumber(const nsAString& aNumber)
|
||||
{
|
||||
mSecondNumber = aNumber;
|
||||
}
|
||||
|
||||
void
|
||||
UpdateSwitchable(bool aSwitchable) {
|
||||
mSwitchable = aSwitchable;
|
||||
@ -172,6 +164,11 @@ public:
|
||||
mMergeable = aMergeable;
|
||||
}
|
||||
|
||||
void
|
||||
UpdateSecondId(TelephonyCallId* aId) {
|
||||
mSecondId = aId;
|
||||
}
|
||||
|
||||
void
|
||||
NotifyError(const nsAString& aError);
|
||||
|
||||
|
77
dom/telephony/TelephonyCallId.cpp
Normal file
77
dom/telephony/TelephonyCallId.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "TelephonyCallId.h"
|
||||
|
||||
#include "nsITelephonyService.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
TelephonyCallId::TelephonyCallId(nsPIDOMWindow* aWindow,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation)
|
||||
: mWindow(aWindow), mNumber(aNumber), mNumberPresentation(aNumberPresentation),
|
||||
mName(aName), mNamePresentation(aNamePresentation)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
TelephonyCallId::~TelephonyCallId()
|
||||
{
|
||||
}
|
||||
|
||||
JSObject*
|
||||
TelephonyCallId::WrapObject(JSContext* aCx)
|
||||
{
|
||||
return TelephonyCallIdBinding::Wrap(aCx, this);
|
||||
}
|
||||
|
||||
CallIdPresentation
|
||||
TelephonyCallId::GetPresentationStr(uint16_t aPresentation) const
|
||||
{
|
||||
switch (aPresentation) {
|
||||
case nsITelephonyService::CALL_PRESENTATION_ALLOWED:
|
||||
return CallIdPresentation::Allowed;
|
||||
case nsITelephonyService::CALL_PRESENTATION_RESTRICTED:
|
||||
return CallIdPresentation::Restricted;
|
||||
case nsITelephonyService::CALL_PRESENTATION_UNKNOWN:
|
||||
return CallIdPresentation::Unknown;
|
||||
case nsITelephonyService::CALL_PRESENTATION_PAYPHONE:
|
||||
return CallIdPresentation::Payphone;
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Bad presentation!");
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TelephonyCallId, mWindow)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(TelephonyCallId)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(TelephonyCallId)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TelephonyCallId)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
// WebIDL
|
||||
|
||||
CallIdPresentation
|
||||
TelephonyCallId::NumberPresentation() const
|
||||
{
|
||||
return GetPresentationStr(mNumberPresentation);
|
||||
}
|
||||
|
||||
CallIdPresentation
|
||||
TelephonyCallId::NamePresentation() const
|
||||
{
|
||||
return GetPresentationStr(mNamePresentation);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
76
dom/telephony/TelephonyCallId.h
Normal file
76
dom/telephony/TelephonyCallId.h
Normal file
@ -0,0 +1,76 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_TelephonyCallId_h
|
||||
#define mozilla_dom_TelephonyCallId_h
|
||||
|
||||
#include "mozilla/dom/TelephonyCallIdBinding.h"
|
||||
#include "mozilla/dom/telephony/TelephonyCommon.h"
|
||||
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class TelephonyCallId MOZ_FINAL : public nsISupports,
|
||||
public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TelephonyCallId)
|
||||
|
||||
TelephonyCallId(nsPIDOMWindow* aWindow, const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation, const nsAString& aName,
|
||||
uint16_t aNamePresentation);
|
||||
|
||||
nsPIDOMWindow*
|
||||
GetParentObject() const
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
virtual JSObject*
|
||||
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||
|
||||
// WebIDL
|
||||
|
||||
void
|
||||
GetNumber(nsString& aNumber) const
|
||||
{
|
||||
aNumber.Assign(mNumber);
|
||||
}
|
||||
|
||||
CallIdPresentation
|
||||
NumberPresentation() const;
|
||||
|
||||
void
|
||||
GetName(nsString& aName) const
|
||||
{
|
||||
aName.Assign(mName);
|
||||
}
|
||||
|
||||
CallIdPresentation
|
||||
NamePresentation() const;
|
||||
|
||||
private:
|
||||
~TelephonyCallId();
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> mWindow;
|
||||
nsString mNumber;
|
||||
uint16_t mNumberPresentation;
|
||||
nsString mName;
|
||||
uint16_t mNamePresentation;
|
||||
|
||||
CallIdPresentation
|
||||
GetPresentationStr(uint16_t aPresentation) const;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_TelephonyCallId_h
|
@ -361,7 +361,9 @@ TelephonyService.prototype = {
|
||||
for (let i = 0, indexes = Object.keys(calls); i < indexes.length; ++i) {
|
||||
let call = calls[indexes[i]];
|
||||
aListener.enumerateCallState(call.clientId, call.callIndex,
|
||||
call.state, call.number, call.isOutgoing,
|
||||
call.state, call.number,
|
||||
call.numberPresentation, call.name,
|
||||
call.namePresentation, call.isOutgoing,
|
||||
call.isEmergency, call.isConference,
|
||||
call.isSwitchable, call.isMergeable);
|
||||
}
|
||||
@ -729,6 +731,9 @@ TelephonyService.prototype = {
|
||||
aCall.callIndex,
|
||||
aCall.state,
|
||||
aCall.number,
|
||||
aCall.numberPresentation,
|
||||
aCall.name,
|
||||
aCall.namePresentation,
|
||||
aCall.isOutgoing,
|
||||
aCall.isEmergency,
|
||||
aCall.isConference,
|
||||
@ -793,6 +798,13 @@ TelephonyService.prototype = {
|
||||
call.isMergeable = aCall.isMergeable != null ?
|
||||
aCall.isMergeable : true;
|
||||
|
||||
call.numberPresentation = aCall.numberPresentation != null ?
|
||||
aCall.numberPresentation : nsITelephonyService.CALL_PRESENTATION_ALLOWED;
|
||||
call.name = aCall.name != null ?
|
||||
aCall.name : "";
|
||||
call.namePresentation = aCall.namePresentation != null ?
|
||||
aCall.namePresentation : nsITelephonyService.CALL_PRESENTATION_ALLOWED;
|
||||
|
||||
this._currentCalls[aClientId][aCall.callIndex] = call;
|
||||
}
|
||||
|
||||
@ -800,6 +812,9 @@ TelephonyService.prototype = {
|
||||
call.callIndex,
|
||||
call.state,
|
||||
call.number,
|
||||
call.numberPresentation,
|
||||
call.name,
|
||||
call.namePresentation,
|
||||
call.isOutgoing,
|
||||
call.isEmergency,
|
||||
call.isConference,
|
||||
@ -807,7 +822,7 @@ TelephonyService.prototype = {
|
||||
call.isMergeable]);
|
||||
},
|
||||
|
||||
notifyCdmaCallWaiting: function(aClientId, aNumber) {
|
||||
notifyCdmaCallWaiting: function(aClientId, aCall) {
|
||||
// We need to acquire a CPU wake lock to avoid the system falling into
|
||||
// the sleep mode when the RIL handles the incoming call.
|
||||
this._acquireCallRingWakeLock();
|
||||
@ -818,7 +833,11 @@ TelephonyService.prototype = {
|
||||
// call comes after a 3way call.
|
||||
this.notifyCallDisconnected(aClientId, call);
|
||||
}
|
||||
this._notifyAllListeners("notifyCdmaCallWaiting", [aClientId, aNumber]);
|
||||
this._notifyAllListeners("notifyCdmaCallWaiting", [aClientId,
|
||||
aCall.number,
|
||||
aCall.numberPresentation,
|
||||
aCall.name,
|
||||
aCall.namePresentation]);
|
||||
},
|
||||
|
||||
notifySupplementaryService: function(aClientId, aCallIndex, aNotification) {
|
||||
|
@ -39,7 +39,7 @@ child:
|
||||
|
||||
NotifyCallStateChanged(uint32_t aClientId, IPCCallStateData aData);
|
||||
|
||||
NotifyCdmaCallWaiting(uint32_t aClientId, nsString aNumber);
|
||||
NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);
|
||||
|
||||
NotifyConferenceCallStateChanged(uint16_t aCallState);
|
||||
|
||||
|
@ -65,6 +65,9 @@ TelephonyChild::RecvNotifyCallStateChanged(const uint32_t& aClientId,
|
||||
aData.callIndex(),
|
||||
aData.callState(),
|
||||
aData.number(),
|
||||
aData.numberPresentation(),
|
||||
aData.name(),
|
||||
aData.namePresentation(),
|
||||
aData.isOutGoing(),
|
||||
aData.isEmergency(),
|
||||
aData.isConference(),
|
||||
@ -75,11 +78,15 @@ TelephonyChild::RecvNotifyCallStateChanged(const uint32_t& aClientId,
|
||||
|
||||
bool
|
||||
TelephonyChild::RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
|
||||
const nsString& aNumber)
|
||||
const IPCCdmaWaitingCallData& aData)
|
||||
{
|
||||
MOZ_ASSERT(mService);
|
||||
|
||||
mService->NotifyCdmaCallWaiting(aClientId, aNumber);
|
||||
mService->NotifyCdmaCallWaiting(aClientId,
|
||||
aData.number(),
|
||||
aData.numberPresentation(),
|
||||
aData.name(),
|
||||
aData.namePresentation());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -158,6 +165,9 @@ TelephonyRequestChild::RecvNotifyEnumerateCallState(const uint32_t& aClientId,
|
||||
aData.callIndex(),
|
||||
aData.callState(),
|
||||
aData.number(),
|
||||
aData.numberPresentation(),
|
||||
aData.name(),
|
||||
aData.namePresentation(),
|
||||
aData.isOutGoing(),
|
||||
aData.isEmergency(),
|
||||
aData.isConference(),
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
|
||||
virtual bool
|
||||
RecvNotifyCdmaCallWaiting(const uint32_t& aClientId,
|
||||
const nsString& aNumber) MOZ_OVERRIDE;
|
||||
const IPCCdmaWaitingCallData& aData) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool
|
||||
RecvNotifyConferenceCallStateChanged(const uint16_t& aCallState) MOZ_OVERRIDE;
|
||||
|
@ -355,6 +355,9 @@ TelephonyIPCService::CallStateChanged(uint32_t aClientId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -363,6 +366,7 @@ TelephonyIPCService::CallStateChanged(uint32_t aClientId,
|
||||
{
|
||||
for (uint32_t i = 0; i < mListeners.Length(); i++) {
|
||||
mListeners[i]->CallStateChanged(aClientId, aCallIndex, aCallState, aNumber,
|
||||
aNumberPresentation, aName, aNamePresentation,
|
||||
aIsOutgoing, aIsEmergency, aIsConference,
|
||||
aIsSwitchable, aIsMergeable);
|
||||
}
|
||||
@ -389,6 +393,9 @@ TelephonyIPCService::EnumerateCallState(uint32_t aClientId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -400,10 +407,14 @@ TelephonyIPCService::EnumerateCallState(uint32_t aClientId,
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyIPCService::NotifyCdmaCallWaiting(uint32_t aClientId,
|
||||
const nsAString& aNumber)
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation)
|
||||
{
|
||||
for (uint32_t i = 0; i < mListeners.Length(); i++) {
|
||||
mListeners[i]->NotifyCdmaCallWaiting(aClientId, aNumber);
|
||||
mListeners[i]->NotifyCdmaCallWaiting(aClientId, aNumber, aNumberPresentation,
|
||||
aName, aNamePresentation);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -283,6 +283,9 @@ TelephonyParent::CallStateChanged(uint32_t aClientId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -292,6 +295,7 @@ TelephonyParent::CallStateChanged(uint32_t aClientId,
|
||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
||||
|
||||
IPCCallStateData data(aCallIndex, aCallState, nsString(aNumber),
|
||||
aNumberPresentation, nsString(aName), aNamePresentation,
|
||||
aIsOutgoing, aIsEmergency, aIsConference,
|
||||
aIsSwitchable, aIsMergeable);
|
||||
return SendNotifyCallStateChanged(aClientId, data) ? NS_OK : NS_ERROR_FAILURE;
|
||||
@ -317,6 +321,9 @@ TelephonyParent::EnumerateCallState(uint32_t aClientId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -328,12 +335,16 @@ TelephonyParent::EnumerateCallState(uint32_t aClientId,
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyParent::NotifyCdmaCallWaiting(uint32_t aClientId,
|
||||
const nsAString& aNumber)
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation)
|
||||
{
|
||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
||||
|
||||
return SendNotifyCdmaCallWaiting(aClientId, nsString(aNumber))
|
||||
? NS_OK : NS_ERROR_FAILURE;
|
||||
IPCCdmaWaitingCallData data(nsString(aNumber), aNumberPresentation,
|
||||
nsString(aName), aNamePresentation);
|
||||
return SendNotifyCdmaCallWaiting(aClientId, data) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -430,6 +441,9 @@ TelephonyRequestParent::CallStateChanged(uint32_t aClientId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -458,6 +472,9 @@ TelephonyRequestParent::EnumerateCallState(uint32_t aClientId,
|
||||
uint32_t aCallIndex,
|
||||
uint16_t aCallState,
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation,
|
||||
bool aIsOutgoing,
|
||||
bool aIsEmergency,
|
||||
bool aIsConference,
|
||||
@ -467,6 +484,7 @@ TelephonyRequestParent::EnumerateCallState(uint32_t aClientId,
|
||||
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
|
||||
|
||||
IPCCallStateData data(aCallIndex, aCallState, nsString(aNumber),
|
||||
aNumberPresentation, nsString(aName), aNamePresentation,
|
||||
aIsOutgoing, aIsEmergency, aIsConference,
|
||||
aIsSwitchable, aIsMergeable);
|
||||
return SendNotifyEnumerateCallState(aClientId, data) ? NS_OK
|
||||
@ -475,7 +493,10 @@ TelephonyRequestParent::EnumerateCallState(uint32_t aClientId,
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyRequestParent::NotifyCdmaCallWaiting(uint32_t aClientId,
|
||||
const nsAString& aNumber)
|
||||
const nsAString& aNumber,
|
||||
uint16_t aNumberPresentation,
|
||||
const nsAString& aName,
|
||||
uint16_t aNamePresentation)
|
||||
{
|
||||
MOZ_CRASH("Not a TelephonyParent!");
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ struct IPCCallStateData
|
||||
uint32_t callIndex;
|
||||
uint16_t callState;
|
||||
nsString number;
|
||||
uint16_t numberPresentation;
|
||||
nsString name;
|
||||
uint16_t namePresentation;
|
||||
bool isOutGoing;
|
||||
bool isEmergency;
|
||||
bool isConference;
|
||||
@ -20,6 +23,14 @@ struct IPCCallStateData
|
||||
bool isMergeable;
|
||||
};
|
||||
|
||||
struct IPCCdmaWaitingCallData
|
||||
{
|
||||
nsString number;
|
||||
uint16_t numberPresentation;
|
||||
nsString name;
|
||||
uint16_t namePresentation;
|
||||
};
|
||||
|
||||
} /* namespace telephony */
|
||||
} /* namespace dom */
|
||||
} /* namespace mozilla */
|
||||
|
@ -15,6 +15,7 @@ EXPORTS.mozilla.dom += [
|
||||
'Telephony.h',
|
||||
'TelephonyCall.h',
|
||||
'TelephonyCallGroup.h',
|
||||
'TelephonyCallId.h',
|
||||
]
|
||||
|
||||
EXPORTS.mozilla.dom.telephony += [
|
||||
@ -32,6 +33,7 @@ UNIFIED_SOURCES += [
|
||||
'Telephony.cpp',
|
||||
'TelephonyCall.cpp',
|
||||
'TelephonyCallGroup.cpp',
|
||||
'TelephonyCallId.cpp',
|
||||
'TelephonyFactory.cpp',
|
||||
]
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
"@mozilla.org/telephony/gonktelephonyservice;1"
|
||||
%}
|
||||
|
||||
[scriptable, uuid(2ff3dcbb-ae63-443e-9c5d-76811f2f9b42)]
|
||||
[scriptable, uuid(8790e2cc-2c68-4ce9-90dc-f68e1b6e4886)]
|
||||
interface nsIGonkTelephonyService : nsITelephonyService
|
||||
{
|
||||
void notifyCallDisconnected(in unsigned long clientId, in jsval call);
|
||||
@ -20,7 +20,7 @@ interface nsIGonkTelephonyService : nsITelephonyService
|
||||
void notifyCallStateChanged(in unsigned long clientId, in jsval call,
|
||||
[optional] in boolean skipStateConversion);
|
||||
|
||||
void notifyCdmaCallWaiting(in unsigned long clientId, in AString number);
|
||||
void notifyCdmaCallWaiting(in unsigned long clientId, in jsval waitingCall);
|
||||
|
||||
void notifySupplementaryService(in unsigned long clientId, in long callIndex,
|
||||
in AString notification);
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(cd83030f-31eb-40c0-8f0e-0edef3527eec)]
|
||||
[scriptable, uuid(464d4cf8-454a-4cdb-9329-bfe7ede97103)]
|
||||
interface nsITelephonyListener : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -18,6 +18,14 @@ interface nsITelephonyListener : nsISupports
|
||||
* One of the nsITelephonyService::CALL_STATE_* values.
|
||||
* @param number
|
||||
* Number of the other party.
|
||||
* @param numberPresentation
|
||||
* Presentation of the call number.
|
||||
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
||||
* @param name
|
||||
* Name of the other party.
|
||||
* @param namePresentation
|
||||
* Presentation of the call name.
|
||||
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
||||
* @param isOutgoing
|
||||
* Indicates whether this call is outgoing or incoming.
|
||||
* @param isEmergency
|
||||
@ -35,6 +43,9 @@ interface nsITelephonyListener : nsISupports
|
||||
in unsigned long callIndex,
|
||||
in unsigned short callState,
|
||||
in AString number,
|
||||
in unsigned short numberPresentation,
|
||||
in AString name,
|
||||
in unsigned short namePresentation,
|
||||
in boolean isOutgoing,
|
||||
in boolean isEmergency,
|
||||
in boolean isConference,
|
||||
@ -71,6 +82,14 @@ interface nsITelephonyListener : nsISupports
|
||||
* One of the nsITelephonyService::CALL_STATE_* values.
|
||||
* @param number
|
||||
* Number of the other party.
|
||||
* @param numberPresentation
|
||||
* Presentation of the call number.
|
||||
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
||||
* @param name
|
||||
* Name of the other party.
|
||||
* @param namePresentation
|
||||
* Presentation of the call name.
|
||||
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
||||
* @param isOutgoing
|
||||
* Indicates whether this call is outgoing or incoming.
|
||||
* @param isConference
|
||||
@ -86,6 +105,9 @@ interface nsITelephonyListener : nsISupports
|
||||
in unsigned long callIndex,
|
||||
in unsigned short callState,
|
||||
in AString number,
|
||||
in unsigned short numberPresentation,
|
||||
in AString name,
|
||||
in unsigned short namePresentation,
|
||||
in boolean isOutgoing,
|
||||
in boolean isEmergency,
|
||||
in boolean isConference,
|
||||
@ -127,8 +149,20 @@ interface nsITelephonyListener : nsISupports
|
||||
Indicate the RIL client, 0 ~ (number of client - 1).
|
||||
* @param number
|
||||
* Number of the other party.
|
||||
* @param numberPresentation
|
||||
* Presentation of the call number.
|
||||
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
||||
* @param name
|
||||
* Name of the other party.
|
||||
* @param namePresentation
|
||||
* Presentation of the call name.
|
||||
* One of the nsITelephonyProvider::CALL_PRESENTATION_* values.
|
||||
*/
|
||||
void notifyCdmaCallWaiting(in unsigned long clientId, in AString number);
|
||||
void notifyCdmaCallWaiting(in unsigned long clientId,
|
||||
in AString number,
|
||||
in unsigned short numberPresentation,
|
||||
in AString name,
|
||||
in unsigned short namePresentation);
|
||||
|
||||
/**
|
||||
* Called when RIL error occurs to creating or separating a conference call.
|
||||
@ -187,6 +221,11 @@ interface nsITelephonyService : nsISupports
|
||||
const unsigned short NOTIFICATION_REMOTE_HELD = 0;
|
||||
const unsigned short NOTIFICATION_REMOTE_RESUMED = 1;
|
||||
|
||||
const unsigned short CALL_PRESENTATION_ALLOWED = 0;
|
||||
const unsigned short CALL_PRESENTATION_RESTRICTED = 1;
|
||||
const unsigned short CALL_PRESENTATION_UNKNOWN = 2;
|
||||
const unsigned short CALL_PRESENTATION_PAYPHONE = 3;
|
||||
|
||||
readonly attribute unsigned long defaultServiceId;
|
||||
|
||||
/**
|
||||
|
@ -288,6 +288,38 @@ let emulator = (function() {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenient helper to check the expected call number and name.
|
||||
*
|
||||
* @param number
|
||||
* A string sent to modem.
|
||||
* @param numberPresentation
|
||||
* An unsigned short integer sent to modem.
|
||||
* @param name
|
||||
* A string sent to modem.
|
||||
* @param namePresentation
|
||||
* An unsigned short integer sent to modem.
|
||||
* @param receivedNumber
|
||||
* A string exposed by Telephony API.
|
||||
* @param receivedName
|
||||
* A string exposed by Telephony API.
|
||||
*/
|
||||
function checkCallId(number, numberPresentation, name, namePresentation,
|
||||
receivedNumber, receivedName) {
|
||||
let expectedNum = !numberPresentation ? number : "";
|
||||
is(receivedNumber, expectedNum, "check number per numberPresentation");
|
||||
|
||||
let expectedName;
|
||||
if (numberPresentation) {
|
||||
expectedName = "";
|
||||
} else if (!namePresentation) {
|
||||
expectedName = name ? name : "";
|
||||
} else {
|
||||
expectedName = "";
|
||||
}
|
||||
is(receivedName, expectedName, "check name per number/namePresentation");
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenient helper to check the call list existing in the emulator.
|
||||
*
|
||||
@ -394,7 +426,7 @@ let emulator = (function() {
|
||||
|
||||
telephony.dial(number, serviceId).then(call => {
|
||||
ok(call);
|
||||
is(call.number, number);
|
||||
is(call.id.number, number);
|
||||
is(call.state, "dialing");
|
||||
is(call.serviceId, serviceId);
|
||||
|
||||
@ -497,14 +529,41 @@ let emulator = (function() {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locally hang up a call.
|
||||
*
|
||||
* @param call
|
||||
* A TelephonyCall object.
|
||||
* @return A deferred promise.
|
||||
*/
|
||||
function hangUp(call) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
call.ondisconnected = function(event) {
|
||||
log("Received 'disconnected' call event");
|
||||
call.ondisconnected = null;
|
||||
checkEventCallState(event, call, "disconnected");
|
||||
deferred.resolve(call);
|
||||
};
|
||||
call.hangUp();
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simulate an incoming call.
|
||||
*
|
||||
* @param number
|
||||
* A string.
|
||||
* @param numberPresentation [optional]
|
||||
* An unsigned short integer.
|
||||
* @param name [optional]
|
||||
* A string.
|
||||
* @param namePresentation [optional]
|
||||
* An unsigned short integer.
|
||||
* @return A deferred promise.
|
||||
*/
|
||||
function remoteDial(number) {
|
||||
function remoteDial(number, numberPresentation, name, namePresentation) {
|
||||
log("Simulating an incoming call.");
|
||||
|
||||
let deferred = Promise.defer();
|
||||
@ -516,13 +575,17 @@ let emulator = (function() {
|
||||
let call = event.call;
|
||||
|
||||
ok(call);
|
||||
is(call.number, number);
|
||||
is(call.state, "incoming");
|
||||
|
||||
checkCallId(number, numberPresentation, name, namePresentation,
|
||||
call.id.number, call.id.name);
|
||||
deferred.resolve(call);
|
||||
};
|
||||
emulator.run("gsm call " + number);
|
||||
|
||||
numberPresentation = numberPresentation || "";
|
||||
name = name || "";
|
||||
namePresentation = namePresentation || "";
|
||||
emulator.run("gsm call " + number + "," + numberPresentation + "," + name +
|
||||
"," + namePresentation);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
@ -544,7 +607,7 @@ let emulator = (function() {
|
||||
checkEventCallState(event, call, "connected");
|
||||
deferred.resolve(call);
|
||||
};
|
||||
emulator.run("gsm accept " + call.number);
|
||||
emulator.run("gsm accept " + call.id.number);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
@ -567,7 +630,7 @@ let emulator = (function() {
|
||||
checkEventCallState(event, call, "disconnected");
|
||||
deferred.resolve(call);
|
||||
};
|
||||
emulator.run("gsm cancel " + call.number);
|
||||
emulator.run("gsm cancel " + call.id.number);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
@ -616,7 +679,7 @@ let emulator = (function() {
|
||||
let check_onconnected = StateEventChecker('connected', 'onresuming');
|
||||
|
||||
for (let call of callsToAdd) {
|
||||
let callName = "callToAdd (" + call.number + ')';
|
||||
let callName = "callToAdd (" + call.id.number + ')';
|
||||
|
||||
let ongroupchange = callName + ".ongroupchange";
|
||||
pending.push(ongroupchange);
|
||||
@ -677,7 +740,7 @@ let emulator = (function() {
|
||||
let check_onheld = StateEventChecker('held', 'onholding');
|
||||
|
||||
for (let call of calls) {
|
||||
let callName = "call (" + call.number + ')';
|
||||
let callName = "call (" + call.id.number + ')';
|
||||
|
||||
let onholding = callName + ".onholding";
|
||||
pending.push(onholding);
|
||||
@ -730,7 +793,7 @@ let emulator = (function() {
|
||||
let check_onconnected = StateEventChecker('connected', 'onresuming');
|
||||
|
||||
for (let call of calls) {
|
||||
let callName = "call (" + call.number + ')';
|
||||
let callName = "call (" + call.id.number + ')';
|
||||
|
||||
let onresuming = callName + ".onresuming";
|
||||
pending.push(onresuming);
|
||||
@ -789,7 +852,7 @@ let emulator = (function() {
|
||||
|
||||
// Remained call in conference will be held.
|
||||
for (let call of remainedCalls) {
|
||||
let callName = "remainedCall (" + call.number + ')';
|
||||
let callName = "remainedCall (" + call.id.number + ')';
|
||||
|
||||
let onstatechange = callName + ".onstatechange";
|
||||
pending.push(onstatechange);
|
||||
@ -800,7 +863,7 @@ let emulator = (function() {
|
||||
// When a call is removed from conference with 2 calls, another one will be
|
||||
// automatically removed from group and be put on hold.
|
||||
for (let call of autoRemovedCalls) {
|
||||
let callName = "autoRemovedCall (" + call.number + ')';
|
||||
let callName = "autoRemovedCall (" + call.id.number + ')';
|
||||
|
||||
let ongroupchange = callName + ".ongroupchange";
|
||||
pending.push(ongroupchange);
|
||||
@ -873,7 +936,7 @@ let emulator = (function() {
|
||||
// When a call is hang up from conference with 2 calls, another one will be
|
||||
// automatically removed from group.
|
||||
for (let call of autoRemovedCalls) {
|
||||
let callName = "autoRemovedCall (" + call.number + ')';
|
||||
let callName = "autoRemovedCall (" + call.id.number + ')';
|
||||
|
||||
let ongroupchange = callName + ".ongroupchange";
|
||||
pending.push(ongroupchange);
|
||||
@ -962,8 +1025,8 @@ let emulator = (function() {
|
||||
function createCallAndAddToConference(inNumber, conferenceCalls) {
|
||||
// Create an info array. allInfo = [info1, info2, ...].
|
||||
let allInfo = conferenceCalls.map(function(call, i) {
|
||||
return (i === 0) ? outCallStrPool(call.number)
|
||||
: inCallStrPool(call.number);
|
||||
return (i === 0) ? outCallStrPool(call.id.number)
|
||||
: inCallStrPool(call.id.number);
|
||||
});
|
||||
|
||||
// Define state property of the info array.
|
||||
@ -1042,6 +1105,7 @@ let emulator = (function() {
|
||||
this.gCheckAll = checkAll;
|
||||
this.gDial = dial;
|
||||
this.gAnswer = answer;
|
||||
this.gHangUp = hangUp;
|
||||
this.gHold = hold;
|
||||
this.gRemoteDial = remoteDial;
|
||||
this.gRemoteAnswer = remoteAnswer;
|
||||
|
@ -57,3 +57,4 @@ disabled = Bug 821958
|
||||
[test_conference_three_hangup_one.js]
|
||||
[test_conference_three_remove_one.js]
|
||||
[test_outgoing_when_two_calls_on_line.js]
|
||||
[test_call_presentation.js]
|
||||
|
71
dom/telephony/test/marionette/test_call_presentation.js
Normal file
71
dom/telephony/test/marionette/test_call_presentation.js
Normal file
@ -0,0 +1,71 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
const ALLOWED = 0;
|
||||
const RESTRICTED = 1;
|
||||
const UNKNOWN = 2;
|
||||
const PAYPHONE =3;
|
||||
|
||||
function getPresentationStr(presentation) {
|
||||
let str;
|
||||
switch (presentation) {
|
||||
case ALLOWED:
|
||||
str = "allowed";
|
||||
break;
|
||||
case RESTRICTED:
|
||||
str = "restricted";
|
||||
break;
|
||||
case UNKNOWN:
|
||||
str = "unknown";
|
||||
break;
|
||||
case PAYPHONE:
|
||||
str = "payphone";
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function getNamePresentation(numberPresentation, namePresentation) {
|
||||
// See TS 23.096 Figure 3a and Annex A Note 1.
|
||||
if (!numberPresentation) {
|
||||
if (namePresentation == undefined) {
|
||||
namePresentation = ALLOWED;
|
||||
}
|
||||
} else {
|
||||
namePresentation = ALLOWED;
|
||||
}
|
||||
return getPresentationStr(namePresentation);
|
||||
}
|
||||
|
||||
function test(number, numberPresentation, name, namePresentation) {
|
||||
return gRemoteDial(number, numberPresentation, name, namePresentation)
|
||||
.then(call => {
|
||||
is(call.id.numberPresentation, getPresentationStr(numberPresentation),
|
||||
"check numberPresentation");
|
||||
is(call.id.namePresentation,
|
||||
getNamePresentation(numberPresentation, namePresentation),
|
||||
"check namePresentation");
|
||||
return call;
|
||||
})
|
||||
.then(gHangUp);
|
||||
}
|
||||
|
||||
startTest(function() {
|
||||
let inNumber = "5555550201";
|
||||
Promise.resolve()
|
||||
.then(() => test(inNumber, ALLOWED))
|
||||
.then(() => test(inNumber, RESTRICTED))
|
||||
.then(() => test(inNumber, UNKNOWN))
|
||||
.then(() => test(inNumber, PAYPHONE))
|
||||
.then(() => test(inNumber, ALLOWED, "TestName"))
|
||||
.then(() => test(inNumber, ALLOWED, "TestName", ALLOWED))
|
||||
.then(() => test(inNumber, ALLOWED, "TestName", RESTRICTED))
|
||||
.then(() => test(inNumber, ALLOWED, "TestName", UNKNOWN))
|
||||
.then(() => test(inNumber, RESTRICTED, "TestName", ALLOWED))
|
||||
.then(() => test(inNumber, RESTRICTED, "TestName", RESTRICTED))
|
||||
.then(() => test(inNumber, RESTRICTED, "TestName", UNKNOWN))
|
||||
.then(finish);
|
||||
});
|
@ -14,7 +14,7 @@ function dial() {
|
||||
telephony.dialEmergency(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
@ -15,7 +15,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
@ -74,7 +74,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
// Should be two calls now
|
||||
|
@ -15,7 +15,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
@ -105,7 +105,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
// Should be two calls now
|
||||
|
@ -15,7 +15,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incoming = event.call;
|
||||
ok(incoming);
|
||||
is(incoming.number, number);
|
||||
is(incoming.id.number, number);
|
||||
is(incoming.state, "incoming");
|
||||
|
||||
//ok(telephony.calls === calls); // bug 717414
|
||||
|
@ -22,7 +22,7 @@ function simulateIncoming() {
|
||||
|
||||
incoming = event.call;
|
||||
ok(incoming);
|
||||
is(incoming.number, number);
|
||||
is(incoming.id.number, number);
|
||||
is(incoming.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -15,7 +15,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, number);
|
||||
is(incomingCall.id.number, number);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -15,7 +15,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incoming = event.call;
|
||||
ok(incoming);
|
||||
is(incoming.number, number);
|
||||
is(incoming.id.number, number);
|
||||
is(incoming.state, "incoming");
|
||||
|
||||
//ok(telephony.calls === calls); // bug 717414
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -16,7 +16,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
@ -99,7 +99,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
is(outgoingCall, telephony.active);
|
||||
is(telephony.calls.length, 2);
|
||||
|
@ -16,7 +16,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
@ -112,7 +112,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
@ -14,7 +14,7 @@ function dial() {
|
||||
telephony.dial(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
@ -25,7 +25,7 @@ function dial() {
|
||||
if (event.call.state == "dialing") {
|
||||
outgoing = event.call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -13,7 +13,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
@ -32,7 +32,7 @@ function dial(number) {
|
||||
let deferred = Promise.defer();
|
||||
telephony.dial(number).then(call => {
|
||||
ok(call);
|
||||
is(call.number, number);
|
||||
is(call.id.number, number);
|
||||
is(call.state, "dialing");
|
||||
|
||||
call.onalerting = function(event) {
|
||||
@ -59,7 +59,7 @@ function remoteAnswer(call) {
|
||||
is(call.state, "connected");
|
||||
deferred.resolve(call);
|
||||
};
|
||||
emulator.run("gsm accept " + call.number);
|
||||
emulator.run("gsm accept " + call.id.number);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ function dial() {
|
||||
telephony.dial(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
@ -13,7 +13,7 @@ function dial() {
|
||||
telephony.dial(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
@ -14,7 +14,7 @@ function dial() {
|
||||
telephony.dial(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
@ -14,7 +14,7 @@ function dial() {
|
||||
telephony.dial(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
is(outgoing, telephony.active);
|
||||
//ok(telephony.calls === calls); // bug 717414
|
||||
|
@ -14,7 +14,7 @@ function dial() {
|
||||
telephony.dial(number).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, number);
|
||||
is(outgoingCall.id.number, number);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
@ -13,7 +13,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
@ -13,7 +13,7 @@ function dial() {
|
||||
telephony.dial(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.id.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
@ -12,7 +12,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
is(outgoingCall, telephony.active);
|
||||
|
@ -14,7 +14,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
is(telephony.calls.length, 1);
|
||||
|
@ -17,7 +17,7 @@ function dial() {
|
||||
telephony.dial(outNumber).then(call => {
|
||||
outgoingCall = call;
|
||||
ok(outgoingCall);
|
||||
is(outgoingCall.number, outNumber);
|
||||
is(outgoingCall.id.number, outNumber);
|
||||
is(outgoingCall.state, "dialing");
|
||||
|
||||
outgoingCall.onalerting = function onalerting(event) {
|
||||
@ -107,7 +107,7 @@ function simulateIncoming() {
|
||||
log("Received 'incoming' call event.");
|
||||
incomingCall = event.call;
|
||||
ok(incomingCall);
|
||||
is(incomingCall.number, inNumber);
|
||||
is(incomingCall.id.number, inNumber);
|
||||
is(incomingCall.state, "incoming");
|
||||
|
||||
// Should be two calls now
|
||||
|
@ -1114,6 +1114,8 @@ var interfaceNamesInGlobalScope =
|
||||
{name: "TelephonyCall", b2g: true, pref: "dom.telephony.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "TelephonyCallGroup", b2g: true, pref: "dom.telephony.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "TelephonyCallId", b2g: true, pref: "dom.telephony.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"Text",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
@ -5,8 +5,8 @@
|
||||
enum MobileNetworkState {"available", "connected", "forbidden"};
|
||||
|
||||
[Pref="dom.mobileconnection.enabled",
|
||||
ChromeConstructor(DOMString shortName, DOMString longName, DOMString mcc,
|
||||
DOMString mnc, DOMString state)]
|
||||
ChromeConstructor(DOMString? shortName, DOMString? longName, DOMString? mcc,
|
||||
DOMString? mnc, DOMString? state)]
|
||||
interface MozMobileNetworkInfo
|
||||
{
|
||||
/**
|
||||
|
@ -9,11 +9,11 @@ interface TelephonyCall : EventTarget {
|
||||
// Indicate which service the call comes from.
|
||||
readonly attribute unsigned long serviceId;
|
||||
|
||||
readonly attribute DOMString number;
|
||||
readonly attribute TelephonyCallId id;
|
||||
|
||||
// In CDMA networks, the 2nd waiting call shares the connection with the 1st
|
||||
// call. We need an additional attribute for the 2nd number.
|
||||
readonly attribute DOMString? secondNumber;
|
||||
// call. We need an additional attribute for the CDMA waiting call.
|
||||
readonly attribute TelephonyCallId? secondId;
|
||||
|
||||
readonly attribute DOMString state;
|
||||
|
||||
|
35
dom/webidl/TelephonyCallId.webidl
Normal file
35
dom/webidl/TelephonyCallId.webidl
Normal file
@ -0,0 +1,35 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
enum CallIdPresentation {
|
||||
"allowed",
|
||||
// Call number/name has been withheld by the calling party.
|
||||
"restricted",
|
||||
// Call number is not available due to calling party being of type payphone.
|
||||
"payphone",
|
||||
// Call number/name is not available due to networking problems or other reason.
|
||||
"unknown"
|
||||
};
|
||||
|
||||
[Pref="dom.telephony.enabled"]
|
||||
interface TelephonyCallId {
|
||||
// It is an empty string when "numberPresentation" is not "allowed."
|
||||
readonly attribute DOMString number;
|
||||
|
||||
// This attribute is not relevant for outgoing calls. Default value is
|
||||
// "allowed."
|
||||
readonly attribute CallIdPresentation numberPresentation;
|
||||
|
||||
// This attribute is not relevant for outgoing calls. It is an empty string
|
||||
// 1) when the call is outgoing, or 2) when the call is incoming and
|
||||
// "namePresentation" is not "allowed." However, it could still be empty
|
||||
// even the call is incoming and "namePresentation" is "allowed."
|
||||
readonly attribute DOMString name;
|
||||
|
||||
// This attribute is not relevant for outgoing calls. Default value is
|
||||
// "allowed."
|
||||
readonly attribute CallIdPresentation namePresentation;
|
||||
};
|
@ -437,6 +437,7 @@ WEBIDL_FILES = [
|
||||
'Telephony.webidl',
|
||||
'TelephonyCall.webidl',
|
||||
'TelephonyCallGroup.webidl',
|
||||
'TelephonyCallId.webidl',
|
||||
'Text.webidl',
|
||||
'TextDecoder.webidl',
|
||||
'TextEncoder.webidl',
|
||||
|
Loading…
Reference in New Issue
Block a user