mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Merge b2g-inbound to m-c.
This commit is contained in:
commit
b2cdbabc6a
@ -19,8 +19,8 @@
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="e5f4683183a1dec2cfdb21b76509819977e9d09c"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
</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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a4baf82a131a7853cf7e7f9cf74253927b2f355"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
@ -128,7 +128,7 @@
|
||||
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
|
||||
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="c3ee0c875393607430086f942950d1b3f496ab0e"/>
|
||||
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="f121175e1c0613f7d5c39be84b5a6330d8d664a0"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="acbdbe5196f06589da05c3bd1f14b27a6cae69c2"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="dd94b2e17a146cb782d71933d25dcaa9c060e6ce"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="e0972cffef81e3833a5dad03a338651ebe55135f"/>
|
||||
|
@ -15,9 +15,9 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
|
@ -19,8 +19,8 @@
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="e5f4683183a1dec2cfdb21b76509819977e9d09c"/>
|
||||
|
@ -18,8 +18,8 @@
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a4baf82a131a7853cf7e7f9cf74253927b2f355"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "6b51afcf6d39fc4b30dc0d9b5d9f5739b2a6fd60",
|
||||
"revision": "2f15fe97023bf41e29660a2d427bd43a3ff181b0",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,8 +17,8 @@
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
|
@ -15,8 +15,8 @@
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
|
@ -19,8 +19,8 @@
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
</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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a4baf82a131a7853cf7e7f9cf74253927b2f355"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
|
@ -17,8 +17,8 @@
|
||||
<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="9ad117d9d7f4d9e76ca235b168a3ac79f870f4c1"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3b2aeeb5af3083c2f6f4b44beae0b4802566d482"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c462d9183d294a2d8ecc472f593ea8cfa15bc9de"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="996b5c6a2fd2b8a0124c0eab80eb72a4daece7bc"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
|
@ -100,6 +100,7 @@ function BrowserElementParent(frameLoader, hasRemoteFrame, isPendingFrame) {
|
||||
debug("Creating new BrowserElementParent object for " + frameLoader);
|
||||
this._domRequestCounter = 0;
|
||||
this._pendingDOMRequests = {};
|
||||
this._pendingSetInputMethodActive = [];
|
||||
this._hasRemoteFrame = hasRemoteFrame;
|
||||
this._nextPaintListeners = [];
|
||||
|
||||
@ -371,6 +372,11 @@ BrowserElementParent.prototype = {
|
||||
|
||||
this._ready = true;
|
||||
|
||||
// Handle pending SetInputMethodActive request.
|
||||
while (this._pendingSetInputMethodActive.length > 0) {
|
||||
this._setInputMethodActive(this._pendingSetInputMethodActive.shift());
|
||||
}
|
||||
|
||||
// Inform our child if our owner element's document is invisible. Note
|
||||
// that we must do so here, rather than in the BrowserElementParent
|
||||
// constructor, because the BrowserElementChild may not be initialized when
|
||||
@ -724,6 +730,12 @@ BrowserElementParent.prototype = {
|
||||
Cr.NS_ERROR_INVALID_ARG);
|
||||
}
|
||||
|
||||
// Wait until browserElementChild is initialized.
|
||||
if (!this._ready) {
|
||||
this._pendingSetInputMethodActive.push(isActive);
|
||||
return;
|
||||
}
|
||||
|
||||
let req = Services.DOMRequest.createRequest(this._window);
|
||||
|
||||
// Deactivate the old input method if needed.
|
||||
@ -733,35 +745,17 @@ BrowserElementParent.prototype = {
|
||||
// we should simply set it to null directly.
|
||||
activeInputFrame = null;
|
||||
this._sendSetInputMethodActiveDOMRequest(req, isActive);
|
||||
} else {
|
||||
let reqOld = XPCNativeWrapper.unwrap(activeInputFrame)
|
||||
.setInputMethodActive(false);
|
||||
|
||||
// We wan't to continue regardless whether this req succeeded
|
||||
reqOld.onsuccess = reqOld.onerror = function() {
|
||||
let setActive = function() {
|
||||
activeInputFrame = null;
|
||||
this._sendSetInputMethodActiveDOMRequest(req, isActive);
|
||||
}.bind(this);
|
||||
|
||||
if (this._ready) {
|
||||
setActive();
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait for the hello event from BrowserElementChild
|
||||
let onReady = function(aMsg) {
|
||||
if (this._isAlive() && (aMsg.data.msg_name === 'hello')) {
|
||||
setActive();
|
||||
|
||||
this._mm.removeMessageListener('browser-element-api:call',
|
||||
onReady);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
this._mm.addMessageListener('browser-element-api:call', onReady);
|
||||
}.bind(this);
|
||||
return req;
|
||||
}
|
||||
|
||||
let reqOld = XPCNativeWrapper.unwrap(activeInputFrame)
|
||||
.setInputMethodActive(false);
|
||||
|
||||
// We wan't to continue regardless whether this req succeeded
|
||||
reqOld.onsuccess = reqOld.onerror = function() {
|
||||
activeInputFrame = null;
|
||||
this._sendSetInputMethodActiveDOMRequest(req, isActive);
|
||||
}.bind(this);
|
||||
} else {
|
||||
this._sendSetInputMethodActiveDOMRequest(req, isActive);
|
||||
}
|
||||
|
@ -172,19 +172,20 @@ GonkCameraHardware::Init()
|
||||
// Disable shutter sound in android CameraService because gaia camera app will play it
|
||||
mCamera->sendCommand(CAMERA_CMD_ENABLE_SHUTTER_SOUND, 0, 0);
|
||||
|
||||
mNativeWindow = new GonkNativeWindow();
|
||||
mNativeWindow->setNewFrameCallback(this);
|
||||
mCamera->setListener(this);
|
||||
|
||||
#if defined(MOZ_WIDGET_GONK)
|
||||
|
||||
#if ANDROID_VERSION >= 19
|
||||
mNativeWindow = new GonkNativeWindow(GonkCameraHardware::MIN_UNDEQUEUED_BUFFERS);
|
||||
mCamera->setPreviewTarget(mNativeWindow->getBufferQueue());
|
||||
#elif (ANDROID_VERSION == 17) || (ANDROID_VERSION == 18)
|
||||
#elif ANDROID_VERSION >= 17
|
||||
mNativeWindow = new GonkNativeWindow();
|
||||
mCamera->setPreviewTexture(mNativeWindow->getBufferQueue());
|
||||
#else
|
||||
mNativeWindow = new GonkNativeWindow();
|
||||
mCamera->setPreviewTexture(mNativeWindow);
|
||||
#endif
|
||||
mNativeWindow->setNewFrameCallback(this);
|
||||
mCamera->setListener(this);
|
||||
|
||||
#if ANDROID_VERSION >= 16
|
||||
rv = mCamera->sendCommand(CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG, 1, 0);
|
||||
|
@ -83,6 +83,15 @@ public:
|
||||
};
|
||||
virtual int GetSensorOrientation(uint32_t aType = RAW_SENSOR_ORIENTATION);
|
||||
|
||||
/**
|
||||
* MIN_UNDEQUEUED_BUFFERS has increased to 4 since Android JB. For FFOS, more
|
||||
* than 3 gralloc buffers are necessary between ImageHost and GonkBufferQueue
|
||||
* for consuming preview stream. To keep the stability for older platform, we
|
||||
* set MIN_UNDEQUEUED_BUFFERS to 4 only in Android KK base.
|
||||
* See also bug 988704.
|
||||
*/
|
||||
enum { MIN_UNDEQUEUED_BUFFERS = 4};
|
||||
|
||||
virtual int AutoFocus();
|
||||
virtual int CancelAutoFocus();
|
||||
virtual int StartFaceDetection();
|
||||
|
@ -205,6 +205,134 @@ BufObject.prototype = {
|
||||
}
|
||||
})();
|
||||
|
||||
const TELEPHONY_REQUESTS = [
|
||||
REQUEST_GET_CURRENT_CALLS,
|
||||
REQUEST_ANSWER,
|
||||
REQUEST_CONFERENCE,
|
||||
REQUEST_DIAL,
|
||||
REQUEST_DIAL_EMERGENCY_CALL,
|
||||
REQUEST_HANGUP,
|
||||
REQUEST_HANGUP_WAITING_OR_BACKGROUND,
|
||||
REQUEST_SEPARATE_CONNECTION,
|
||||
REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE,
|
||||
REQUEST_UDUB
|
||||
];
|
||||
|
||||
function TelephonyRequestEntry(request, action, options) {
|
||||
this.request = request;
|
||||
this.action = action;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
function TelephonyRequestQueue(ril) {
|
||||
this.ril = ril;
|
||||
this.currentQueue = null; // Point to the current running queue.
|
||||
|
||||
this.queryQueue = [];
|
||||
this.controlQueue = [];
|
||||
}
|
||||
TelephonyRequestQueue.prototype = {
|
||||
ril: null,
|
||||
|
||||
_getQueue: function(request) {
|
||||
return (request === REQUEST_GET_CURRENT_CALLS) ? this.queryQueue
|
||||
: this.controlQueue;
|
||||
},
|
||||
|
||||
_getAnotherQueue: function(queue) {
|
||||
return (this.queryQueue === queue) ? this.controlQueue : this.queryQueue;
|
||||
},
|
||||
|
||||
_find: function(queue, request) {
|
||||
for (let i = 0; i < queue.length; ++i) {
|
||||
if (queue[i].request === request) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
|
||||
_startQueue: function(queue) {
|
||||
if (queue.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We only need to keep one entry for queryQueue.
|
||||
if (queue === this.queryQueue) {
|
||||
queue.splice(1, queue.length - 1);
|
||||
}
|
||||
|
||||
this.currentQueue = queue;
|
||||
for (let entry of queue) {
|
||||
this._executeEntry(entry);
|
||||
}
|
||||
},
|
||||
|
||||
_executeEntry: function(entry) {
|
||||
if (DEBUG) this.debug("execute " + this._getRequestName(entry.request));
|
||||
entry.action.call(this.ril, entry.options);
|
||||
},
|
||||
|
||||
_getRequestName: function(request) {
|
||||
let method = this.ril[request];
|
||||
return (typeof method === 'function') ? method.name : "";
|
||||
},
|
||||
|
||||
debug: function(msg) {
|
||||
this.ril.context.debug("[TeleQ] " + msg);
|
||||
},
|
||||
|
||||
isValidRequest: function(request) {
|
||||
return TELEPHONY_REQUESTS.indexOf(request) !== -1;
|
||||
},
|
||||
|
||||
push: function(request, action, options) {
|
||||
if (!this.isValidRequest(request)) {
|
||||
if (DEBUG) {
|
||||
this.debug("Error: " + this._getRequestName(request) +
|
||||
" is not a telephony request");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (DEBUG) this.debug("push " + this._getRequestName(request));
|
||||
let entry = new TelephonyRequestEntry(request, action, options);
|
||||
let queue = this._getQueue(request);
|
||||
queue.push(entry);
|
||||
|
||||
// Try to run the request.
|
||||
if (this.currentQueue === queue) {
|
||||
this._executeEntry(entry);
|
||||
} else if (!this.currentQueue) {
|
||||
this._startQueue(queue);
|
||||
}
|
||||
},
|
||||
|
||||
pop: function(request) {
|
||||
if (!this.isValidRequest(request)) {
|
||||
if (DEBUG) {
|
||||
this.debug("Error: " + this._getRequestName(request) +
|
||||
" is not a telephony request");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (DEBUG) this.debug("pop " + this._getRequestName(request));
|
||||
let queue = this._getQueue(request);
|
||||
let index = this._find(queue, request);
|
||||
if (index === -1) {
|
||||
throw new Error("Cannot find the request in telephonyRequestQueue.");
|
||||
} else {
|
||||
queue.splice(index, 1);
|
||||
}
|
||||
|
||||
if (queue.length === 0) {
|
||||
this.currentQueue = null;
|
||||
this._startQueue(this._getAnotherQueue(queue));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The RIL state machine.
|
||||
*
|
||||
@ -215,6 +343,7 @@ BufObject.prototype = {
|
||||
function RilObject(aContext) {
|
||||
this.context = aContext;
|
||||
|
||||
this.telephonyRequestQueue = new TelephonyRequestQueue(this);
|
||||
this.currentCalls = {};
|
||||
this.currentConference = {state: null, participants: {}};
|
||||
this.currentDataCalls = {};
|
||||
@ -1361,6 +1490,11 @@ RilObject.prototype = {
|
||||
* Get current calls.
|
||||
*/
|
||||
getCurrentCalls: function() {
|
||||
this.telephonyRequestQueue.push(REQUEST_GET_CURRENT_CALLS,
|
||||
this.sendRilRequestGetCurrentCalls, null);
|
||||
},
|
||||
|
||||
sendRilRequestGetCurrentCalls: function() {
|
||||
this.context.Buf.simpleRequest(REQUEST_GET_CURRENT_CALLS);
|
||||
},
|
||||
|
||||
@ -1506,6 +1640,11 @@ RilObject.prototype = {
|
||||
},
|
||||
|
||||
sendDialRequest: function(options) {
|
||||
this.telephonyRequestQueue.push(options.request, this.sendRilRequestDial,
|
||||
options);
|
||||
},
|
||||
|
||||
sendRilRequestDial: function(options) {
|
||||
// Always succeed.
|
||||
options.success = true;
|
||||
this.sendChromeMessage(options);
|
||||
@ -1563,13 +1702,18 @@ RilObject.prototype = {
|
||||
call.hangUpLocal = true;
|
||||
|
||||
if (call.state === CALL_STATE_HOLDING) {
|
||||
this.sendHangUpBackgroundRequest(callIndex);
|
||||
this.sendHangUpBackgroundRequest();
|
||||
} else {
|
||||
this.sendHangUpRequest(callIndex);
|
||||
}
|
||||
},
|
||||
|
||||
sendHangUpRequest: function(callIndex) {
|
||||
this.telephonyRequestQueue.push(REQUEST_HANGUP, this.sendRilRequestHangUp,
|
||||
callIndex);
|
||||
},
|
||||
|
||||
sendRilRequestHangUp: function(callIndex) {
|
||||
let Buf = this.context.Buf;
|
||||
Buf.newParcel(REQUEST_HANGUP);
|
||||
Buf.writeInt32(1);
|
||||
@ -1577,9 +1721,13 @@ RilObject.prototype = {
|
||||
Buf.sendParcel();
|
||||
},
|
||||
|
||||
sendHangUpBackgroundRequest: function(callIndex) {
|
||||
let Buf = this.context.Buf;
|
||||
Buf.simpleRequest(REQUEST_HANGUP_WAITING_OR_BACKGROUND);
|
||||
sendHangUpBackgroundRequest: function() {
|
||||
this.telephonyRequestQueue.push(REQUEST_HANGUP_WAITING_OR_BACKGROUND,
|
||||
this.sendRilRequestHangUpWaiting, null);
|
||||
},
|
||||
|
||||
sendRilRequestHangUpWaiting: function() {
|
||||
this.context.Buf.simpleRequest(REQUEST_HANGUP_WAITING_OR_BACKGROUND);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1612,18 +1760,31 @@ RilObject.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
let Buf = this.context.Buf;
|
||||
switch (call.state) {
|
||||
case CALL_STATE_INCOMING:
|
||||
Buf.simpleRequest(REQUEST_ANSWER);
|
||||
this.telephonyRequestQueue.push(REQUEST_ANSWER, this.sendRilRequestAnswer,
|
||||
null);
|
||||
break;
|
||||
case CALL_STATE_WAITING:
|
||||
// Answer the waiting (second) call, and hold the first call.
|
||||
Buf.simpleRequest(REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE);
|
||||
this.sendSwitchWaitingRequest();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
sendRilRequestAnswer: function() {
|
||||
this.context.Buf.simpleRequest(REQUEST_ANSWER);
|
||||
},
|
||||
|
||||
sendSwitchWaitingRequest: function() {
|
||||
this.telephonyRequestQueue.push(REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE,
|
||||
this.sendRilRequestSwitch, null);
|
||||
},
|
||||
|
||||
sendRilRequestSwitch: function() {
|
||||
this.context.Buf.simpleRequest(REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE);
|
||||
},
|
||||
|
||||
/**
|
||||
* Reject an incoming/waiting call.
|
||||
*
|
||||
@ -1642,24 +1803,28 @@ RilObject.prototype = {
|
||||
|
||||
call.hangUpLocal = true;
|
||||
|
||||
let Buf = this.context.Buf;
|
||||
if (this._isCdma) {
|
||||
// AT+CHLD=0 means "release held or UDUB."
|
||||
Buf.simpleRequest(REQUEST_HANGUP_WAITING_OR_BACKGROUND);
|
||||
this.sendHangUpBackgroundRequest();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (call.state) {
|
||||
case CALL_STATE_INCOMING:
|
||||
Buf.simpleRequest(REQUEST_UDUB);
|
||||
this.telephonyRequestQueue.push(REQUEST_UDUB, this.sendRilRequestUdub,
|
||||
null);
|
||||
break;
|
||||
case CALL_STATE_WAITING:
|
||||
// Reject the waiting (second) call, and remain the first call.
|
||||
Buf.simpleRequest(REQUEST_HANGUP_WAITING_OR_BACKGROUND);
|
||||
this.sendHangUpBackgroundRequest();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
sendRilRequestUdub: function() {
|
||||
this.context.Buf.simpleRequest(REQUEST_UDUB);
|
||||
},
|
||||
|
||||
holdCall: function(options) {
|
||||
let call = this.currentCalls[options.callIndex];
|
||||
if (!call) {
|
||||
@ -1674,7 +1839,7 @@ RilObject.prototype = {
|
||||
options.featureStr = "";
|
||||
this.sendCdmaFlashCommand(options);
|
||||
} else if (call.state == CALL_STATE_ACTIVE) {
|
||||
Buf.simpleRequest(REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE, options);
|
||||
this.sendSwitchWaitingRequest();
|
||||
}
|
||||
},
|
||||
|
||||
@ -1692,7 +1857,7 @@ RilObject.prototype = {
|
||||
options.featureStr = "";
|
||||
this.sendCdmaFlashCommand(options);
|
||||
} else if (call.state == CALL_STATE_HOLDING) {
|
||||
Buf.simpleRequest(REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE, options);
|
||||
this.sendSwitchWaitingRequest();
|
||||
}
|
||||
},
|
||||
|
||||
@ -1700,16 +1865,20 @@ RilObject.prototype = {
|
||||
_hasConferenceRequest: false,
|
||||
|
||||
conferenceCall: function(options) {
|
||||
let Buf = this.context.Buf;
|
||||
if (this._isCdma) {
|
||||
options.featureStr = "";
|
||||
this.sendCdmaFlashCommand(options);
|
||||
} else {
|
||||
this._hasConferenceRequest = true;
|
||||
Buf.simpleRequest(REQUEST_CONFERENCE, options);
|
||||
this.telephonyRequestQueue.push(REQUEST_CONFERENCE,
|
||||
this.sendRilRequestConference, options);
|
||||
}
|
||||
},
|
||||
|
||||
sendRilRequestConference: function(options) {
|
||||
this.context.Buf.simpleRequest(REQUEST_CONFERENCE, options);
|
||||
},
|
||||
|
||||
separateCall: function(options) {
|
||||
let call = this.currentCalls[options.callIndex];
|
||||
if (!call) {
|
||||
@ -1720,24 +1889,30 @@ RilObject.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
let Buf = this.context.Buf;
|
||||
if (this._isCdma) {
|
||||
options.featureStr = "";
|
||||
this.sendCdmaFlashCommand(options);
|
||||
} else {
|
||||
Buf.newParcel(REQUEST_SEPARATE_CONNECTION, options);
|
||||
Buf.writeInt32(1);
|
||||
Buf.writeInt32(options.callIndex);
|
||||
Buf.sendParcel();
|
||||
this.telephonyRequestQueue.push(REQUEST_SEPARATE_CONNECTION,
|
||||
this.sendRilRequestSeparateConnection,
|
||||
options);
|
||||
}
|
||||
},
|
||||
|
||||
sendRilRequestSeparateConnection: function(options) {
|
||||
let Buf = this.context.Buf;
|
||||
Buf.newParcel(REQUEST_SEPARATE_CONNECTION, options);
|
||||
Buf.writeInt32(1);
|
||||
Buf.writeInt32(options.callIndex);
|
||||
Buf.sendParcel();
|
||||
},
|
||||
|
||||
holdConference: function() {
|
||||
if (this._isCdma) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.context.Buf.simpleRequest(REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE);
|
||||
this.sendSwitchWaitingRequest();
|
||||
},
|
||||
|
||||
resumeConference: function() {
|
||||
@ -1745,7 +1920,7 @@ RilObject.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
this.context.Buf.simpleRequest(REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE);
|
||||
this.sendSwitchWaitingRequest();
|
||||
},
|
||||
|
||||
/**
|
||||
@ -5262,6 +5437,10 @@ RilObject.prototype = {
|
||||
if (DEBUG) this.context.debug("Handling parcel as " + method.name);
|
||||
method.call(this, length, options);
|
||||
}
|
||||
|
||||
if (this.telephonyRequestQueue.isValidRequest(request_type)) {
|
||||
this.telephonyRequestQueue.pop(request_type);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -5396,7 +5575,9 @@ RilObject.prototype[REQUEST_DIAL] = function REQUEST_DIAL(length, options) {
|
||||
}).bind(this));
|
||||
}
|
||||
};
|
||||
RilObject.prototype[REQUEST_DIAL_EMERGENCY_CALL] = RilObject.prototype[REQUEST_DIAL];
|
||||
RilObject.prototype[REQUEST_DIAL_EMERGENCY_CALL] = function REQUEST_DIAL_EMERGENCY_CALL(length, options) {
|
||||
RilObject.prototype[REQUEST_DIAL](length, options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
@ -5425,6 +5606,7 @@ RilObject.prototype[REQUEST_HANGUP_WAITING_OR_BACKGROUND] = function REQUEST_HAN
|
||||
|
||||
this.getCurrentCalls();
|
||||
};
|
||||
// TODO Bug 1012599: This one is not used.
|
||||
RilObject.prototype[REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND] = function REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
@ -5433,14 +5615,10 @@ RilObject.prototype[REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND] = function REQU
|
||||
this.getCurrentCalls();
|
||||
};
|
||||
RilObject.prototype[REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE] = function REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
if (!options.success) {
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
this.sendChromeMessage(options);
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendChromeMessage(options);
|
||||
this.getCurrentCalls();
|
||||
};
|
||||
RilObject.prototype[REQUEST_CONFERENCE] = function REQUEST_CONFERENCE(length, options) {
|
||||
@ -5455,7 +5633,8 @@ RilObject.prototype[REQUEST_CONFERENCE] = function REQUEST_CONFERENCE(length, op
|
||||
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_UDUB] = null;
|
||||
RilObject.prototype[REQUEST_UDUB] = function REQUEST_UDUB(length, options) {
|
||||
};
|
||||
RilObject.prototype[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_FAIL_CAUSE(length, options) {
|
||||
let Buf = this.context.Buf;
|
||||
let num = length ? Buf.readInt32() : 0;
|
||||
@ -5861,7 +6040,8 @@ RilObject.prototype[REQUEST_GET_IMEISV] = function REQUEST_GET_IMEISV(length, op
|
||||
|
||||
this.IMEISV = this.context.Buf.readString();
|
||||
};
|
||||
RilObject.prototype[REQUEST_ANSWER] = null;
|
||||
RilObject.prototype[REQUEST_ANSWER] = function REQUEST_ANSWER(length, options) {
|
||||
};
|
||||
RilObject.prototype[REQUEST_DEACTIVATE_DATA_CALL] = function REQUEST_DEACTIVATE_DATA_CALL(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
|
@ -748,7 +748,6 @@ TelephonyProvider.prototype = {
|
||||
gSystemMessenger.broadcastMessage("telephony-call-ended", data);
|
||||
|
||||
aCall.clientId = aClientId;
|
||||
this._updateActiveCall(aCall, null);
|
||||
|
||||
let manualConfStateChange = false;
|
||||
let childId = this._currentCalls[aClientId][aCall.callIndex].childId;
|
||||
@ -775,6 +774,8 @@ TelephonyProvider.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
this._updateActiveCall(aCall, null);
|
||||
|
||||
if (!aCall.failCause ||
|
||||
aCall.failCause === RIL.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING) {
|
||||
this._notifyAllListeners("callStateChanged", [aClientId,
|
||||
|
@ -50,36 +50,6 @@ let emulator = (function() {
|
||||
};
|
||||
}());
|
||||
|
||||
// Delay 1s before each telephony.dial()
|
||||
// The workaround here should be removed after bug 1005816.
|
||||
|
||||
let originalDial;
|
||||
|
||||
function delayTelephonyDial() {
|
||||
originalDial = telephony.dial;
|
||||
telephony.dial = function(number, serviceId) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
let startTime = Date.now();
|
||||
waitFor(function() {
|
||||
originalDial.call(telephony, number, serviceId).then(call => {
|
||||
deferred.resolve(call);
|
||||
}, cause => {
|
||||
deferred.reject(cause);
|
||||
});
|
||||
}, function() {
|
||||
duration = Date.now() - startTime;
|
||||
return (duration >= 1000);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
}
|
||||
|
||||
function restoreTelephonyDial() {
|
||||
telephony.dial = originalDial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Telephony related helper functions.
|
||||
*/
|
||||
@ -1097,7 +1067,6 @@ function _startTest(permissions, test) {
|
||||
// Make sure that we get the telephony after adding permission.
|
||||
telephony = window.navigator.mozTelephony;
|
||||
ok(telephony);
|
||||
delayTelephonyDial();
|
||||
conference = telephony.conferenceGroup;
|
||||
ok(conference);
|
||||
return gClearCalls().then(gCheckInitialState);
|
||||
@ -1109,7 +1078,6 @@ function _startTest(permissions, test) {
|
||||
|
||||
function tearDown() {
|
||||
log("== Test TearDown ==");
|
||||
restoreTelephonyDial();
|
||||
emulator.waitFinish()
|
||||
.then(() => {
|
||||
permissionTearDown();
|
||||
|
@ -4,120 +4,28 @@
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
let number;
|
||||
let emergency;
|
||||
let outgoing;
|
||||
function testEmergencyLabel(number, emergency) {
|
||||
log("= testEmergencyLabel = " + number + " should be " +
|
||||
(emergency ? "emergency" : "normal") + " call");
|
||||
|
||||
let testCase = 0;
|
||||
let expectedResults = [
|
||||
["112", true],
|
||||
["911", true],
|
||||
["0912345678", false],
|
||||
["777", false],
|
||||
];
|
||||
let outCall;
|
||||
|
||||
function createGoldenCallListResult0(number, state) {
|
||||
// "outbound to xxxxxxxxxx : ringing"
|
||||
let padPattern = " ";
|
||||
let pad = padPattern.substring(0, padPattern.length - number.length);
|
||||
return "outbound to " + number + pad + " : " + state;
|
||||
}
|
||||
|
||||
function dial() {
|
||||
log("Make an outgoing call.");
|
||||
|
||||
telephony.dial(number).then(call => {
|
||||
outgoing = call;
|
||||
ok(outgoing);
|
||||
is(outgoing.number, number);
|
||||
is(outgoing.state, "dialing");
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
is(telephony.calls.length, 1);
|
||||
is(telephony.calls[0], outgoing);
|
||||
|
||||
outgoing.onalerting = function onalerting(event) {
|
||||
log("Received 'onalerting' call event.");
|
||||
is(outgoing, event.call);
|
||||
is(outgoing.state, "alerting");
|
||||
is(outgoing.emergency, emergency);
|
||||
|
||||
emulator.run("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], createGoldenCallListResult0(number, "ringing"));
|
||||
is(result[1], "OK");
|
||||
answer();
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function answer() {
|
||||
log("Answering the call.");
|
||||
|
||||
// We get no "connecting" event when the remote party answers the call.
|
||||
|
||||
outgoing.onconnected = function onconnected(event) {
|
||||
log("Received 'connected' call event.");
|
||||
is(outgoing, event.call);
|
||||
is(outgoing.state, "connected");
|
||||
is(outgoing.emergency, emergency);
|
||||
|
||||
is(outgoing, telephony.active);
|
||||
|
||||
emulator.run("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], createGoldenCallListResult0(number, "active"));
|
||||
is(result[1], "OK");
|
||||
hangUp();
|
||||
});
|
||||
};
|
||||
emulator.run("gsm accept " + number);
|
||||
}
|
||||
|
||||
function hangUp() {
|
||||
log("Hanging up the call.");
|
||||
|
||||
// We get no "disconnecting" event when the remote party terminates the call.
|
||||
|
||||
outgoing.ondisconnected = function ondisconnected(event) {
|
||||
log("Received 'disconnected' call event.");
|
||||
is(outgoing, event.call);
|
||||
is(outgoing.state, "disconnected");
|
||||
is(outgoing.emergency, emergency);
|
||||
|
||||
is(telephony.active, null);
|
||||
is(telephony.calls.length, 0);
|
||||
|
||||
emulator.run("gsm list", function(result) {
|
||||
log("Call list is now: " + result);
|
||||
is(result[0], "OK");
|
||||
verifyNextEmergencyLabel();
|
||||
});
|
||||
};
|
||||
emulator.run("gsm cancel " + number);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
finish();
|
||||
}
|
||||
|
||||
function verifyNextEmergencyLabel() {
|
||||
if (testCase >= expectedResults.length) {
|
||||
cleanUp();
|
||||
} else {
|
||||
log("Running test case: " + testCase + "/" + expectedResults.length);
|
||||
number = expectedResults[testCase][0];
|
||||
emergency = expectedResults[testCase][1];
|
||||
testCase++;
|
||||
|
||||
// No more calls in the list; give time for emulator to catch up
|
||||
waitFor(dial, function() {
|
||||
return (telephony.calls.length === 0);
|
||||
});
|
||||
}
|
||||
return gDial(number)
|
||||
.then(call => { outCall = call; })
|
||||
.then(() => {
|
||||
is(outCall.emergency, emergency, "emergency result should be correct");
|
||||
})
|
||||
.then(() => gRemoteAnswer(outCall))
|
||||
.then(() => {
|
||||
is(outCall.emergency, emergency, "emergency result should be correct");
|
||||
})
|
||||
.then(() => gRemoteHangUp(outCall));
|
||||
}
|
||||
|
||||
startTest(function() {
|
||||
verifyNextEmergencyLabel();
|
||||
testEmergencyLabel("112", true)
|
||||
.then(() => testEmergencyLabel("911", true))
|
||||
.then(() => testEmergencyLabel("0912345678", false))
|
||||
.then(() => testEmergencyLabel("777", false))
|
||||
.then(finish);
|
||||
});
|
||||
|
@ -34,10 +34,10 @@ using namespace mozilla::layers;
|
||||
|
||||
namespace android {
|
||||
|
||||
GonkNativeWindow::GonkNativeWindow() :
|
||||
GonkNativeWindow::GonkNativeWindow(int bufferCount) :
|
||||
GonkConsumerBase(new GonkBufferQueue(true), false)
|
||||
{
|
||||
mConsumer->setMaxAcquiredBufferCount(GonkBufferQueue::MIN_UNDEQUEUED_BUFFERS);
|
||||
mConsumer->setMaxAcquiredBufferCount(bufferCount);
|
||||
}
|
||||
|
||||
GonkNativeWindow::GonkNativeWindow(const sp<GonkBufferQueue>& bq,
|
||||
|
@ -67,7 +67,7 @@ class GonkNativeWindow: public GonkConsumerBase
|
||||
// access at the same time.
|
||||
// controlledByApp tells whether this consumer is controlled by the
|
||||
// application.
|
||||
GonkNativeWindow();
|
||||
GonkNativeWindow(int bufferCount = GonkBufferQueue::MIN_UNDEQUEUED_BUFFERS);
|
||||
GonkNativeWindow(const sp<GonkBufferQueue>& bq, uint32_t consumerUsage,
|
||||
int bufferCount = GonkBufferQueue::MIN_UNDEQUEUED_BUFFERS,
|
||||
bool controlledByApp = false);
|
||||
|
Loading…
Reference in New Issue
Block a user