merge b2g-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-06-30 15:35:24 +02:00
commit abd9302a89
60 changed files with 401 additions and 290 deletions

View File

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

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>

View File

@ -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="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

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

View File

@ -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="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "b6c6dcfdef46399b88637c93a4f76d4425f7c096",
"revision": "2c2f2fa0a101f07cbb206cca2e69ef3a7b18244c",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c510babaf88dfa2cfe2c202afb2649ee124569af"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="7f9ec13a30f1b2cc8bdb1a199b7da54b9ab8860f"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de14e61098b742251b34f856e48649db8bed552c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bc3bbf42d2a606f6b7038881cff5ec3795fdf953"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="bbb7659d8ea2afb396f99b3dc971ab3c42da3778"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -11,7 +11,6 @@ const Cr = Components.results;
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Promise.jsm");

View File

@ -15,9 +15,11 @@ const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/IndexedDBHelper.jsm");
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberUtils",
"resource://gre/modules/PhoneNumberUtils.jsm");
Cu.importGlobalProperties(["indexedDB"]);
/* all exported symbols need to be bound to this on B2G - Bug 961777 */

View File

@ -15,8 +15,11 @@ this.EXPORTED_SYMBOLS = ["ContactService"];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/ContactDB.jsm");
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ContactDB",
"resource://gre/modules/ContactDB.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberUtils",
"resource://gre/modules/PhoneNumberUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
"@mozilla.org/parentprocessmessagemanager;1",

View File

@ -11,8 +11,11 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
Cu.importGlobalProperties(["indexedDB"]);
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
const RIL_GETMESSAGESCURSOR_CID =
Components.ID("{484d1ad8-840e-4782-9dc4-9ebc4d914937}");

View File

@ -8,9 +8,13 @@
this.EXPORTED_SYMBOLS = ["PhoneNumber"];
Components.utils.import("resource://gre/modules/PhoneNumberMetaData.jsm");
Components.utils.import("resource://gre/modules/PhoneNumberNormalizer.jsm");
const Cu = Components.utils;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, "PHONE_NUMBER_META_DATA",
"resource://gre/modules/PhoneNumberMetaData.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberNormalizer",
"resource://gre/modules/PhoneNumberNormalizer.jsm");
this.PhoneNumber = (function (dataBase) {
// Use strict in our context only - users might not want it
'use strict';

View File

@ -14,8 +14,10 @@ const Ci = Components.interfaces;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import("resource://gre/modules/PhoneNumberNormalizer.jsm");
Cu.import("resource://gre/modules/mcc_iso3166_table.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumberNormalizer",
"resource://gre/modules/PhoneNumberNormalizer.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "MCC_ISO3166_TABLE",
"resource://gre/modules/mcc_iso3166_table.jsm");
#ifdef MOZ_B2G_RIL
XPCOMUtils.defineLazyServiceGetter(this, "mobileConnection",
@ -196,7 +198,8 @@ this.PhoneNumberUtils = {
let inParent = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime)
.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
if (inParent) {
Cu.import("resource://gre/modules/PhoneNumber.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PhoneNumber",
"resource://gre/modules/PhoneNumber.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
"@mozilla.org/parentprocessmessagemanager;1",
"nsIMessageListenerManager");

View File

@ -22,8 +22,11 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
let NFC = {};
Cu.import("resource://gre/modules/nfc_consts.js", NFC);
XPCOMUtils.defineLazyGetter(this, "NFC", function () {
let obj = {};
Cu.import("resource://gre/modules/nfc_consts.js", obj);
return obj;
});
Cu.import("resource://gre/modules/systemlibs.js");
const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true";

View File

@ -23,8 +23,11 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
let NFC = {};
Cu.import("resource://gre/modules/nfc_consts.js", NFC);
XPCOMUtils.defineLazyGetter(this, "NFC", function () {
let obj = {};
Cu.import("resource://gre/modules/nfc_consts.js", obj);
return obj;
});
Cu.import("resource://gre/modules/systemlibs.js");
const NFC_ENABLED = libcutils.property_get("ro.moz.nfc.enabled", "false") === "true";

View File

@ -21,8 +21,11 @@ Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown";

View File

@ -24,8 +24,11 @@ Cu.import("resource://gre/modules/systemlibs.js");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
// Ril quirk to attach data registration on demand.
let RILQUIRKS_DATA_REGISTRATION_ON_DEMAND =
@ -1629,9 +1632,7 @@ WorkerMessenger.prototype = {
libcutils.property_get("ro.moz.ril.send_stk_profile_dl", "false") == "true",
dataRegistrationOnDemand: RILQUIRKS_DATA_REGISTRATION_ON_DEMAND,
subscriptionControl: RILQUIRKS_SUBSCRIPTION_CONTROL
},
rilEmergencyNumbers: libcutils.property_get("ril.ecclist") ||
libcutils.property_get("ro.ril.ecclist")
}
};
this.send(null, "setInitialOptions", options);

View File

@ -52,9 +52,6 @@ if (!this.debug) {
};
}
let RIL_EMERGENCY_NUMBERS;
const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
// Timeout value for emergency callback mode.
const EMERGENCY_CB_MODE_TIMEOUT_MS = 300000; // 5 mins = 300000 ms.
@ -1555,7 +1552,7 @@ RilObject.prototype = {
cachedDialRequest : null,
/**
* Dial the phone.
* Dial a non-emergency number.
*
* @param number
* String containing the number to dial.
@ -1564,34 +1561,13 @@ RilObject.prototype = {
* @param uusInfo
* Integer doing something XXX TODO
*/
dial: function(options) {
dialNonEmergencyNumber: function(options) {
let onerror = (function onerror(options, errorMsg) {
options.success = false;
options.errorMsg = errorMsg;
this.sendChromeMessage(options);
}).bind(this, options);
if (this._isEmergencyNumber(options.number)) {
this.dialEmergencyNumber(options, onerror);
} else {
if (!this._isCdma) {
// TODO: Both dial() and sendMMI() functions should be unified at some
// point in the future. In the mean time we handle temporary CLIR MMI
// commands through the dial() function. Please see bug 889737.
let mmi = this._parseMMI(options.number);
if (mmi && this._isTemporaryModeCLIR(mmi)) {
options.number = mmi.dialNumber;
// In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI
// presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B.
options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ?
CLIR_SUPPRESSION : CLIR_INVOCATION;
}
}
this.dialNonEmergencyNumber(options, onerror);
}
},
dialNonEmergencyNumber: function(options, onerror) {
if (this.radioState == GECKO_RADIOSTATE_OFF) {
// Notify error in establishing the call without radio.
onerror(GECKO_ERROR_RADIO_NOT_AVAILABLE);
@ -1609,17 +1585,41 @@ RilObject.prototype = {
this.exitEmergencyCbMode();
}
if (this._isCdma && Object.keys(this.currentCalls).length == 1) {
// Make a Cdma 3way call.
options.featureStr = options.number;
this.sendCdmaFlashCommand(options);
} else {
options.request = REQUEST_DIAL;
this.sendDialRequest(options);
if (!this._isCdma) {
// TODO: Both dial() and sendMMI() functions should be unified at some
// point in the future. In the mean time we handle temporary CLIR MMI
// commands through the dial() function. Please see bug 889737.
let mmi = this._parseMMI(options.number);
if (mmi && this._isTemporaryModeCLIR(mmi)) {
options.number = mmi.dialNumber;
// In temporary mode, MMI_PROCEDURE_ACTIVATION means allowing CLI
// presentation, i.e. CLIR_SUPPRESSION. See TS 22.030, Annex B.
options.clirMode = mmi.procedure == MMI_PROCEDURE_ACTIVATION ?
CLIR_SUPPRESSION : CLIR_INVOCATION;
}
}
options.request = REQUEST_DIAL;
this.sendDialRequest(options);
},
dialEmergencyNumber: function(options, onerror) {
/**
* Dial an emergency number.
*
* @param number
* String containing the number to dial.
* @param clirMode
* Integer for showing/hidding the caller Id to the called party.
* @param uusInfo
* Integer doing something XXX TODO
*/
dialEmergencyNumber: function(options) {
let onerror = (function onerror(options, errorMsg) {
options.success = false;
options.errorMsg = errorMsg;
this.sendChromeMessage(options);
}).bind(this, options);
options.request = RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL ?
REQUEST_DIAL_EMERGENCY_CALL : REQUEST_DIAL;
if (this.radioState == GECKO_RADIOSTATE_OFF) {
@ -1636,20 +1636,20 @@ RilObject.prototype = {
return;
}
this.sendDialRequest(options);
},
sendDialRequest: function(options) {
if (this._isCdma && Object.keys(this.currentCalls).length == 1) {
// Make a Cdma 3way call.
options.featureStr = options.number;
this.sendCdmaFlashCommand(options);
} else {
this.sendDialRequest(options);
this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial,
options);
}
},
sendDialRequest: function(options) {
this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial,
options);
},
sendRilRequestDial: function(options) {
let Buf = this.context.Buf;
Buf.newParcel(options.request, options);
@ -2417,9 +2417,8 @@ RilObject.prototype = {
return false;
}
if (this._isEmergencyNumber(mmiString)) {
return false;
}
// TODO: Should take care of checking if the string is an emergency number
// in Bug 889737. See Bug 1023141 for more background.
// In a call case.
if (Object.getOwnPropertyNames(this.currentCalls).length > 0) {
@ -3309,38 +3308,18 @@ RilObject.prototype = {
},
/**
* Check a given number against the list of emergency numbers provided by the RIL.
* Checks whether to temporarily suppress caller id for the call.
*
* @param number
* The number to look up.
* @param mmi
* MMI full object.
*/
_isEmergencyNumber: function(number) {
// Check ril provided numbers first.
let numbers = RIL_EMERGENCY_NUMBERS;
if (numbers) {
numbers = numbers.split(",");
} else {
// No ecclist system property, so use our own list.
numbers = DEFAULT_EMERGENCY_NUMBERS;
}
return numbers.indexOf(number) != -1;
},
/**
* Checks whether to temporarily suppress caller id for the call.
*
* @param mmi
* MMI full object.
*/
_isTemporaryModeCLIR: function(mmi) {
return (mmi &&
mmi.serviceCode == MMI_SC_CLIR &&
mmi.dialNumber &&
(mmi.procedure == MMI_PROCEDURE_ACTIVATION ||
mmi.procedure == MMI_PROCEDURE_DEACTIVATION));
},
_isTemporaryModeCLIR: function(mmi) {
return (mmi &&
mmi.serviceCode == MMI_SC_CLIR &&
mmi.dialNumber &&
(mmi.procedure == MMI_PROCEDURE_ACTIVATION ||
mmi.procedure == MMI_PROCEDURE_DEACTIVATION));
},
/**
* Report STK Service is running.
@ -4055,6 +4034,7 @@ RilObject.prototype = {
for (let i in newCalls) {
if (newCalls[i].state !== CALL_STATE_INCOMING) {
callIndex = newCalls[i].callIndex;
newCalls[i].isEmergency = options.isEmergency;
break;
}
}
@ -4105,9 +4085,9 @@ RilObject.prototype = {
newCall.isOutgoing = true;
}
// Set flag for outgoing emergency call.
newCall.isEmergency = newCall.isOutgoing &&
this._isEmergencyNumber(newCall.number);
if (newCall.isEmergency === undefined) {
newCall.isEmergency = false;
}
// Set flag for conference.
newCall.isConference = newCall.isMpty ? true : false;

View File

@ -122,8 +122,9 @@ add_test(function test_request_exit_emergencyCbMode_when_dial() {
};
// Dial non-emergency call.
context.RIL.dial({number: "0912345678",
isDialEmergency: false});
context.RIL.dialNonEmergencyNumber({number: "0912345678",
isEmergency: false,
isDialEmergency: false});
// Should clear timeout event.
do_check_eq(context.RIL._exitEmergencyCbModeTimeoutID, null);

View File

@ -10,9 +10,13 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/systemlibs.js");
var RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
return obj;
});
const GONK_TELEPHONYSERVICE_CONTRACTID =
"@mozilla.org/telephony/gonktelephonyservice;1";
@ -47,6 +51,8 @@ const AUDIO_STATE_NAME = [
"PHONE_STATE_IN_CALL"
];
const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
let DEBUG;
function debug(s) {
dump("TelephonyService: " + s + "\n");
@ -327,6 +333,26 @@ TelephonyService.prototype = {
}).bind(this));
},
/**
* Check a given number against the list of emergency numbers provided by the
* RIL.
*
* @param aNumber
* The number to look up.
*/
_isEmergencyNumber: function(aNumber) {
// Check ril provided numbers first.
let numbers = libcutils.property_get("ril.ecclist") ||
libcutils.property_get("ro.ril.ecclist");
if (numbers) {
numbers = numbers.split(",");
} else {
// No ecclist system property, so use our own list.
numbers = DEFAULT_EMERGENCY_NUMBERS;
}
return numbers.indexOf(aNumber) != -1;
},
/**
* nsITelephonyService interface.
*/
@ -474,9 +500,14 @@ TelephonyService.prototype = {
this.notifyCallStateChanged(aClientId, parentCall);
};
let isEmergencyNumber = this._isEmergencyNumber(aNumber);
let msg = isEmergencyNumber ?
"dialEmergencyNumber" :
"dialNonEmergencyNumber";
this.isDialing = true;
this._getClient(aClientId).sendWorkerMessage("dial", {
this._getClient(aClientId).sendWorkerMessage(msg, {
number: aNumber,
isEmergency: isEmergencyNumber,
isDialEmergency: aIsEmergency
}, (function(response) {
this.isDialing = false;

View File

@ -14,12 +14,20 @@ let emulator = (function() {
let pendingCmdCount = 0;
let originalRunEmulatorCmd = runEmulatorCmd;
let pendingShellCount = 0;
let originalRunEmulatorShell = runEmulatorShell;
// Overwritten it so people could not call this function directly.
runEmulatorCmd = function() {
throw "Use emulator.runWithCallback(cmd, callback) instead of runEmulatorCmd";
throw "Use emulator.runCmdWithCallback(cmd, callback) instead of runEmulatorCmd";
};
function run(cmd) {
// Overwritten it so people could not call this function directly.
runEmulatorShell = function() {
throw "Use emulator.runShellCmd(cmd, callback) instead of runEmulatorShell";
};
function runCmd(cmd) {
let deferred = Promise.defer();
pendingCmdCount++;
@ -36,14 +44,29 @@ let emulator = (function() {
return deferred.promise;
}
function runWithCallback(cmd, callback) {
run(cmd).then(result => {
function runCmdWithCallback(cmd, callback) {
runCmd(cmd).then(result => {
if (callback && typeof callback === "function") {
callback(result);
}
});
}
/**
* @return Promise
*/
function runShellCmd(aCommands) {
let deferred = Promise.defer();
++pendingShellCount;
originalRunEmulatorShell(aCommands, function(aResult) {
--pendingShellCount;
deferred.resolve(aResult);
});
return deferred.promise;
}
/**
* @return Promise
*/
@ -53,15 +76,16 @@ let emulator = (function() {
waitFor(function() {
deferred.resolve();
}, function() {
return pendingCmdCount === 0;
return pendingCmdCount === 0 && pendingShellCount === 0;
});
return deferred.promise;
}
return {
run: run,
runWithCallback: runWithCallback,
runCmd: runCmd,
runCmdWithCallback: runCmdWithCallback,
runShellCmd: runShellCmd,
waitFinish: waitFinish
};
}());
@ -123,7 +147,7 @@ let emulator = (function() {
return Promise.all(hangUpPromises)
.then(() => {
return emulator.run("gsm clear");
return emulator.runCmd("gsm clear").then(waitForNoCall);
})
.then(waitForNoCall);
}
@ -361,7 +385,7 @@ let emulator = (function() {
* @return A deferred promise.
*/
function checkEmulatorCallList(expectedCallList) {
return emulator.run("gsm list").then(result => {
return emulator.runCmd("gsm list").then(result => {
log("Call list is now: " + result);
for (let i = 0; i < expectedCallList.length; ++i) {
is(result[i], expectedCallList[i], "emulator calllist");
@ -611,7 +635,7 @@ let emulator = (function() {
numberPresentation = numberPresentation || "";
name = name || "";
namePresentation = namePresentation || "";
emulator.run("gsm call " + number + "," + numberPresentation + "," + name +
emulator.runCmd("gsm call " + number + "," + numberPresentation + "," + name +
"," + namePresentation);
return deferred.promise;
}
@ -634,7 +658,7 @@ let emulator = (function() {
checkEventCallState(event, call, "connected");
deferred.resolve(call);
};
emulator.run("gsm accept " + call.id.number);
emulator.runCmd("gsm accept " + call.id.number);
return deferred.promise;
}
@ -657,7 +681,7 @@ let emulator = (function() {
checkEventCallState(event, call, "disconnected");
deferred.resolve(call);
};
emulator.run("gsm cancel " + call.id.number);
emulator.runCmd("gsm cancel " + call.id.number);
return deferred.promise;
}

View File

@ -31,7 +31,7 @@ function answer() {
return(callDuration >= 2000);
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function cleanUp(){

View File

@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
function muxModem(id) {
let deferred = Promise.defer();
emulator.runWithCallback("mux modem " + id, function() {
emulator.runCmdWithCallback("mux modem " + id, function() {
deferred.resolve();
});

View File

@ -7,7 +7,7 @@ MARIONETTE_HEAD_JS = 'head.js';
function muxModem(id) {
let deferred = Promise.defer();
emulator.runWithCallback("mux modem " + id, function() {
emulator.runCmdWithCallback("mux modem " + id, function() {
deferred.resolve();
});

View File

@ -28,7 +28,7 @@ function dial() {
is(outgoing.state, "alerting");
is(outgoing.emergency, true);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -49,13 +49,13 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
@ -71,12 +71,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -16,7 +16,7 @@ function dial() {
is(telephony.calls.length, 0);
is(cause, "BadNumberError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
cleanUp();
});

View File

@ -4,7 +4,43 @@
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
function testEmergencyLabel(number, emergency) {
const DEFAULT_ECC_LIST = "112,911";
function setEccListProperty(list) {
log("Set property ril.ecclist: " + list);
let deferred = Promise.defer();
try {
emulator.runShellCmd(["setprop","ril.ecclist", list]).then(function() {
deferred.resolve(list);
});
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
}
function getEccListProperty() {
log("Get property ril.ecclist.");
let deferred = Promise.defer();
try {
emulator.runShellCmd(["getprop","ril.ecclist"]).then(function(aResult) {
let list = !aResult.length ? "" : aResult[0];
deferred.resolve(list);
});
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
}
function testEmergencyLabel(number, list) {
if (!list) {
list = DEFAULT_ECC_LIST;
}
let index = list.split(",").indexOf(number);
let emergency = index != -1;
log("= testEmergencyLabel = " + number + " should be " +
(emergency ? "emergency" : "normal") + " call");
@ -23,12 +59,27 @@ function testEmergencyLabel(number, emergency) {
}
startTest(function() {
testEmergencyLabel("112", true)
.then(() => testEmergencyLabel("911", true))
.then(() => testEmergencyLabel("0912345678", false))
.then(() => testEmergencyLabel("777", false))
.then(null, () => {
ok(false, 'promise rejects during test.');
let origEccList;
let eccList;
getEccListProperty()
.then(list => {
origEccList = eccList = list;
})
.then(() => testEmergencyLabel("112", eccList))
.then(() => testEmergencyLabel("911", eccList))
.then(() => testEmergencyLabel("0912345678", eccList))
.then(() => testEmergencyLabel("777", eccList))
.then(() => {
eccList = "777,119";
return setEccListProperty(eccList);
})
.then(() => testEmergencyLabel("777", eccList))
.then(() => testEmergencyLabel("119", eccList))
.then(() => testEmergencyLabel("112", eccList))
.then(() => setEccListProperty(origEccList))
.then(null, error => {
ok(false, 'promise rejects during test: ' + error);
})
.then(finish);
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -47,7 +47,7 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -61,7 +61,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
// With one connected call already, simulate an incoming call
@ -80,14 +80,14 @@ function simulateIncoming() {
is(telephony.calls[0], outgoingCall);
is(telephony.calls[1], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
is(result[1], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
// Answer incoming call; original outgoing call should be held
@ -111,7 +111,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
is(outgoingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : active");
@ -143,7 +143,7 @@ function hangUpOutgoing() {
is(telephony.calls.length, 1);
is(incomingCall.state, "connected");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hangUpIncoming();
@ -174,7 +174,7 @@ function hangUpIncoming() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -47,7 +47,7 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -61,7 +61,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function holdCall() {
@ -85,7 +85,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
simulateIncoming();
@ -110,14 +110,14 @@ function simulateIncoming() {
is(telephony.calls[0], outgoingCall);
is(telephony.calls[1], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
// Answer incoming call; original outgoing call should be held
@ -141,7 +141,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
is(outgoingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : active");
@ -173,7 +173,7 @@ function hangUpOutgoing() {
is(telephony.calls.length, 1);
is(incomingCall.state, "connected");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hangUpIncoming();
@ -204,7 +204,7 @@ function hangUpIncoming() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -50,7 +50,7 @@ function answer() {
is(incoming, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hangUp();
@ -79,7 +79,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -28,14 +28,14 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -60,7 +60,7 @@ function answer() {
is(incoming, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hangUp();
@ -109,7 +109,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
remoteHangUp();
@ -70,12 +70,12 @@ function remoteHangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -77,7 +77,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -59,12 +59,12 @@ function remoteHangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hold();
@ -78,7 +78,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
hangUp();
@ -107,7 +107,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -21,13 +21,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
answer();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function answer() {
@ -49,7 +49,7 @@ function answer() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hold();
@ -79,7 +79,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : held");
// Wait on hold for a couple of seconds
@ -111,7 +111,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : active");
hangUp();
@ -140,7 +140,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -45,7 +45,7 @@ function answerIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hold();
@ -71,7 +71,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
resume();
@ -97,7 +97,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hangUp();
@ -122,7 +122,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incoming);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + number + " : incoming");
reject();
});
};
emulator.runWithCallback("gsm call " + number);
emulator.runCmdWithCallback("gsm call " + number);
}
function reject() {
@ -51,7 +51,7 @@ function reject() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
cancelIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function cancelIncoming(){
@ -42,12 +42,12 @@ function cancelIncoming(){
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
hold();
@ -78,7 +78,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
hangUp();
@ -100,12 +100,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + inNumber);
emulator.runCmdWithCallback("gsm cancel " + inNumber);
}
function cleanUp() {

View File

@ -22,13 +22,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -49,7 +49,7 @@ function answerIncoming() {
ok(gotConnecting);
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
holdCall();
@ -80,7 +80,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
dial();
@ -108,7 +108,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : ringing");
@ -129,14 +129,14 @@ function answerOutgoing() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : active");
holdSecondCall();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
// With one held call and one active, hold the active one; expect the first
@ -187,7 +187,7 @@ function verifyCalls() {
is(telephony.calls[0], incomingCall);
is(telephony.calls[1], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
is(result[1], "outbound to " + outNumber + " : held");
@ -218,7 +218,7 @@ function hangUpIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
hangUpOutgoing();
@ -249,7 +249,7 @@ function hangUpOutgoing() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -29,13 +29,13 @@ function simulateIncoming() {
};
let rcvdEmulatorCallback = false;
emulator.runWithCallback("gsm call " + inNumber, function(result) {
emulator.runCmdWithCallback("gsm call " + inNumber, function(result) {
rcvdEmulatorCallback = true;
});
}
function verifyCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
@ -61,7 +61,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
holdCall();
@ -92,7 +92,7 @@ function holdCall(){
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
dial();
@ -121,7 +121,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : ringing");
@ -150,13 +150,13 @@ function answerOutgoing() {
};
let rcvdEmulatorCallback = false;
emulator.runWithCallback("gsm accept " + outNumber, function(result) {
emulator.runCmdWithCallback("gsm accept " + outNumber, function(result) {
rcvdEmulatorCallback = true;
});
}
function checkCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
is(result[1], "outbound to " + outNumber + " : active");
@ -187,7 +187,7 @@ function hangUpIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hangUpOutgoing();
@ -218,7 +218,7 @@ function hangUpOutgoing() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -27,7 +27,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -48,13 +48,13 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
@ -70,12 +70,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -46,7 +46,7 @@ function dial() {
}
function checkCallList() {
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
if (((result[0] == "outbound to " + number + " : unknown") ||
(result[0] == "outbound to " + number + " : dialing"))) {
@ -69,19 +69,19 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list (after 'connected' event) is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hangUp() {
log("Hanging up the outgoing call.");
emulator.runWithCallback("gsm cancel " + number);
emulator.runCmdWithCallback("gsm cancel " + number);
}
function cleanUp() {

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -47,13 +47,13 @@ function answer() {
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hangUp();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hangUp() {
@ -76,7 +76,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -59,7 +59,7 @@ function remoteAnswer(call) {
is(call.state, "connected");
deferred.resolve(call);
};
emulator.runWithCallback("gsm accept " + call.id.number);
emulator.runCmdWithCallback("gsm accept " + call.id.number);
return deferred.promise;
}

View File

@ -30,7 +30,7 @@ function dial() {
ok(event.call.error);
is(event.call.error.name, "BadNumberError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
cleanUp();
});

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
busy();
@ -42,13 +42,13 @@ function busy() {
is(outgoing, event.call);
is(event.call.error.name, "BusyError");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm busy " + number);
emulator.runCmdWithCallback("gsm busy " + number);
}
function cleanUp() {

View File

@ -24,7 +24,7 @@ function dial() {
outgoing.onalerting = function onalerting(event) {
log("Received 'alerting' call event.");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
hangUp();
@ -54,7 +54,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -47,13 +47,13 @@ function answer() {
is(outgoing, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hold() {
@ -75,7 +75,7 @@ function hold() {
is(telephony.active, null);
is(telephony.calls.length, 1);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : held");
hangUp();
@ -104,7 +104,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -26,7 +26,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
answer();
@ -47,13 +47,13 @@ function answer() {
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + number);
emulator.runCmdWithCallback("gsm accept " + number);
}
function hold() {
@ -77,7 +77,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : held");
// Bug 781604: emulator assertion if outgoing call kept on hold
@ -111,7 +111,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : active");
hangUp();
@ -140,7 +140,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -28,7 +28,7 @@ function dial() {
ok(expectedStates.indexOf(event.call.state) != -1);
if (event.call.state == "alerting") {
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -49,13 +49,13 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hold() {
@ -74,7 +74,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
resume();
@ -100,7 +100,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hangUp();
@ -125,7 +125,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -47,7 +47,7 @@ function dial(number) {
is(telephony.calls.length, 0);
is(cause, "RadioNotAvailable");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Initial call list: " + result);
setRadioEnabled(true, cleanUp);

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoing, event.call);
is(outgoing.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + number + " : ringing");
reject();
@ -53,13 +53,13 @@ function reject() {
};
let rcvdEmulatorCallback = false;
emulator.runWithCallback("gsm cancel " + number, function(result) {
emulator.runCmdWithCallback("gsm cancel " + number, function(result) {
rcvdEmulatorCallback = true;
});
}
function verifyCallList(){
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});

View File

@ -25,7 +25,7 @@ function dial() {
is(outgoingCall, event.call);
is(outgoingCall.state, "alerting");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -46,13 +46,13 @@ function answer() {
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
hold();
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function hold() {
@ -75,7 +75,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
hangUp();
@ -97,12 +97,12 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});
};
emulator.runWithCallback("gsm cancel " + outNumber);
emulator.runCmdWithCallback("gsm cancel " + outNumber);
}
function cleanUp() {

View File

@ -20,13 +20,13 @@ function simulateIncoming() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
function answerIncoming() {
@ -48,7 +48,7 @@ function answerIncoming() {
is(incomingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
answerAlreadyConnected();
@ -100,7 +100,7 @@ function hold() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
holdAlreadyHeld();
@ -176,7 +176,7 @@ function resume() {
is(telephony.calls.length, 1);
is(telephony.calls[0], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : active");
resumeNonHeld();
@ -227,7 +227,7 @@ function hangUp() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
answerDisconnected();
});

View File

@ -29,7 +29,7 @@ function dial() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : ringing");
answer();
@ -49,7 +49,7 @@ function answer() {
is(outgoingCall.state, "connected");
is(outgoingCall, telephony.active);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
@ -63,7 +63,7 @@ function answer() {
}
});
};
emulator.runWithCallback("gsm accept " + outNumber);
emulator.runCmdWithCallback("gsm accept " + outNumber);
}
function holdCall() {
@ -87,7 +87,7 @@ function holdCall() {
is(telephony.calls.length, 1);
is(telephony.calls[0], outgoingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
simulateIncoming();
@ -112,14 +112,14 @@ function simulateIncoming() {
is(telephony.calls[0], outgoingCall);
is(telephony.calls[1], incomingCall);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : incoming");
answerIncoming();
});
};
emulator.runWithCallback("gsm call " + inNumber);
emulator.runCmdWithCallback("gsm call " + inNumber);
}
// Answer incoming call; original outgoing call should be held
@ -145,7 +145,7 @@ function answerIncoming() {
is(outgoingCall.state, "held");
is(incomingCall.state, "connected");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : held");
is(result[1], "inbound from " + inNumber + " : active");
@ -198,7 +198,7 @@ function verifySwap() {
is(outgoingCall.state, "connected");
is(incomingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "outbound to " + outNumber + " : active");
is(result[1], "inbound from " + inNumber + " : held");
@ -230,7 +230,7 @@ function hangUpOutgoing() {
is(telephony.calls.length, 1);
is(incomingCall.state, "held");
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
is(result[0], "inbound from " + inNumber + " : held");
hangUpIncoming();
@ -261,7 +261,7 @@ function hangUpIncoming() {
is(telephony.active, null);
is(telephony.calls.length, 0);
emulator.runWithCallback("gsm list", function(result) {
emulator.runCmdWithCallback("gsm list", function(result) {
log("Call list is now: " + result);
cleanUp();
});