Merge b2g-inbound to m-c.

This commit is contained in:
Ryan VanderMeulen 2014-01-23 15:39:44 -05:00
commit 7aa1d694bd
33 changed files with 466 additions and 270 deletions

View File

@ -401,6 +401,7 @@ pref("dom.mozBrowserFramesEnabled", true);
pref("dom.ipc.processCount", 100000);
pref("dom.ipc.browser_frames.oop_by_default", false);
pref("dom.browser_frames.useAsyncPanZoom", false);
// SMS/MMS
pref("dom.sms.enabled", true);

View File

@ -651,3 +651,10 @@ SettingsListener.observe("accessibility.screenreader", false, function(value) {
});
});
})();
// =================== AsyncPanZoom ======================
SettingsListener.observe('apz.force-enable', false, function(value) {
Services.prefs.setBoolPref('dom.browser_frames.useAsyncPanZoom', value);
});

View File

@ -12,13 +12,13 @@
<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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="87aa8679560ce09f6445621d6f370d9de722cdba"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -11,10 +11,10 @@
</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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
<project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
<!-- Stock Android things -->

View File

@ -12,13 +12,13 @@
<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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="87aa8679560ce09f6445621d6f370d9de722cdba"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -1,4 +1,4 @@
{
"revision": "630d27e5cff74e12e319572dff2b1acd632dc326",
"revision": "9506ca996d28109df7dc8db6e381f54a83aa20ff",
"repo_path": "/integration/gaia-central"
}

View File

@ -11,12 +11,12 @@
<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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>

View File

@ -10,7 +10,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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>

View File

@ -12,12 +12,12 @@
<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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>

View File

@ -11,12 +11,12 @@
<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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>

View File

@ -11,10 +11,10 @@
</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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
<project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
<!-- Stock Android things -->

View File

@ -11,12 +11,12 @@
<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="00d8d05f0d0730a3cbf17635ad6a6b197a2ce7c9"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="290efee3de3a12c9d803f4650d50bc7c7a8e1f2d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="96d2d00165f4561fbde62d1062706eab74b3a01f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4addd530e2dc1708745d11d81de21b5d1230ed41"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a887bfabaed83c4588b40c845535c0388c8da0f3"/>
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>

View File

@ -247,6 +247,7 @@ if test -n "$gonkdir" ; then
AC_SUBST(MOZ_OMX_DECODER)
MOZ_OMX_ENCODER=1
AC_SUBST(MOZ_OMX_ENCODER)
AC_DEFINE(MOZ_OMX_ENCODER)
;;
19)
GONK_INCLUDES="-I$gonkdir/frameworks/native/include"

View File

@ -2058,7 +2058,9 @@ nsFrameLoader::TryRemoteBrowser()
nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
nsCOMPtr<mozIApplication> containingApp = GetContainingApp();
ScrollingBehavior scrollingBehavior = DEFAULT_SCROLLING;
if (mOwnerContent->AttrValueIs(kNameSpaceID_None,
if (Preferences::GetBool("dom.browser_frames.useAsyncPanZoom", false) ||
mOwnerContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::mozasyncpanzoom,
nsGkAtoms::_true,
eCaseMatters)) {

View File

@ -25,7 +25,6 @@ if CONFIG['MOZ_OPUS']:
UNIFIED_SOURCES += ['OpusTrackEncoder.cpp']
if CONFIG['MOZ_OMX_ENCODER']:
DEFINES['MOZ_OMX_ENCODER'] = True
EXPORTS += ['OmxTrackEncoder.h']
UNIFIED_SOURCES += ['OmxTrackEncoder.cpp']

View File

@ -0,0 +1,65 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
const { Services } = Cu.import('resource://gre/modules/Services.jsm');
var browser = Services.wm.getMostRecentWindow('navigator:browser');
var connection = browser.navigator.mozMobileConnections[0];
// provide a fake APN and enable data connection.
function enableDataConnection() {
let setLock = browser.navigator.mozSettings.createLock();
setLock.set({
'ril.data.enabled': true,
'ril.data.apnSettings': [
[
{'carrier':'T-Mobile US',
'apn':'epc.tmobile.com',
'mmsc':'http://mms.msg.eng.t-mobile.com/mms/wapenc',
'types':['default','supl','mms']}
]
]
});
}
// enable 3G radio
function enableRadio() {
if (connection.radioState !== 'enabled') {
connection.setRadioEnabled(true);
}
}
// disable 3G radio
function disableRadio() {
if (connection.radioState === 'enabled') {
connection.setRadioEnabled(false);
}
}
addMessageListener('prepare-network', function(message) {
//RIL DOM events will be pending until RIL receiveing system-message-listener-ready event.
Services.obs.notifyObservers(null, 'system-message-listener-ready', null);
connection.addEventListener('datachange', function onDataChange() {
if (connection.data.connected) {
connection.removeEventListener('datachange', onDataChange);
Services.prefs.setIntPref('network.proxy.type', 2);
sendAsyncMessage('network-ready', true);
}
});
enableRadio();
enableDataConnection();
});
addMessageListener('network-cleanup', function(message) {
connection.addEventListener('datachange', function onDataChange() {
if (!connection.data.connected) {
connection.removeEventListener('datachange', onDataChange);
Services.prefs.setIntPref('network.proxy.type', 2);
sendAsyncMessage('network-disabled', true);
}
});
disableRadio();
});

View File

@ -4,6 +4,7 @@ support-files =
mediaStreamPlayback.js
pc.js
templates.js
NetworkPreparationChromeScript.js
[test_dataChannel_basicAudio.html]
[test_dataChannel_basicAudioVideo.html]
@ -52,3 +53,5 @@ skip-if = os == 'mac'
[test_peerConnection_setRemoteOfferInHaveLocalOffer.html]
[test_peerConnection_throwInCallbacks.html]
[test_peerConnection_toJSON.html]
# Bug950317: Hack for making a cleanup hook after finishing all WebRTC cases
[test_zmedia_cleanup.html]

View File

@ -323,6 +323,75 @@ MediaElementChecker.prototype = {
}
};
/**
* Query function for determining if any IP address is available for
* generating SDP.
*
* @return false if required additional network setup.
*/
function isNetworkReady() {
// for gonk platform
if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
var listService = SpecialPowers.Cc["@mozilla.org/network/interface-list-service;1"]
.getService(SpecialPowers.Ci.nsINetworkInterfaceListService);
var itfList = listService.getDataInterfaceList(
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_MMS_INTERFACES |
SpecialPowers.Ci.nsINetworkInterfaceListService.LIST_NOT_INCLUDE_SUPL_INTERFACES);
var num = itfList.getNumberOfInterface();
for (var i = 0; i < num; i++) {
if (itfList.getInterface(i).ip) {
info("Network interface is ready with address: " + itfList.getInterface(i).ip);
return true;
}
}
// ip address is not available
info("Network interface is not ready, required additional network setup");
return false;
}
info("Network setup is not required");
return true;
}
/**
* Network setup utils for Gonk
*
* @return {object} providing functions for setup/teardown data connection
*/
function getNetworkUtils() {
var url = SimpleTest.getTestFileURL("NetworkPreparationChromeScript.js");
var script = SpecialPowers.loadChromeScript(url);
var utils = {
/**
* Utility for setting up data connection.
*
* @param aCallback callback after data connection is ready.
*/
prepareNetwork: function(aCallback) {
script.addMessageListener('network-ready', function (message) {
info("Network interface is ready");
aCallback();
});
info("Setup network interface");
script.sendAsyncMessage("prepare-network", true);
},
/**
* Utility for tearing down data connection.
*
* @param aCallback callback after data connection is closed.
*/
tearDownNetwork: function(aCallback) {
script.addMessageListener('network-disabled', function (message) {
ok(true, 'network-disabled');
script.destroy();
aCallback();
});
script.sendAsyncMessage("network-cleanup", true);
}
};
return utils;
}
/**
* This class handles tests for peer connections.
@ -349,6 +418,27 @@ function PeerConnectionTest(options) {
options.is_local = "is_local" in options ? options.is_local : true;
options.is_remote = "is_remote" in options ? options.is_remote : true;
var netTeardownCommand = null;
if (!isNetworkReady()) {
var utils = getNetworkUtils();
// Trigger network setup to obtain IP address before creating any PeerConnection.
utils.prepareNetwork(function() {
ok(isNetworkReady(),'setup network connection successfully');
});
netTeardownCommand = [
[
'TEARDOWN_NETWORK',
function(test) {
utils.tearDownNetwork(function() {
info('teardown network connection');
test.next();
});
}
]
];
}
if (options.is_local)
this.pcLocal = new PeerConnectionWrapper('pcLocal', options.config_pc1);
else
@ -370,6 +460,11 @@ function PeerConnectionTest(options) {
this.chain.filterOut(/^PC_REMOTE/);
}
// Insert network teardown after testcase execution.
if (netTeardownCommand) {
this.chain.append(netTeardownCommand);
}
var self = this;
this.chain.onFinished = function () {
self.teardown();

View File

@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
var url = SimpleTest.getTestFileURL("NetworkPreparationChromeScript.js");
var script = SpecialPowers.loadChromeScript(url);
script.addMessageListener('network-disabled', function (message) {
ok(true, 'network-disabled');
script.destroy();
SimpleTest.finish();
});
script.sendAsyncMessage("network-cleanup", true);
} else {
ok(true, 'no need to cleanup network interface');
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>

View File

@ -107,8 +107,6 @@ MobileConnection::Init(nsPIDOMWindow* aWindow)
DebugOnly<nsresult> rv = mProvider->RegisterMobileConnectionMsg(mClientId, mListener);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Failed registering mobile connection messages with provider");
printf_stderr("MobileConnection initialized");
}
}

View File

@ -173,11 +173,8 @@ add_test(function test_internalSaveStats_singleSample() {
});
add_test(function test_internalSaveStats_arraySamples() {
clearStore('net_stats_store', function() {
var networks = getNetworks();
netStatsDb.clearStats(networks, function (error, result) {
do_check_eq(error, null);
var network = [networks[0].id, networks[0].type];
var samples = 2;
@ -203,12 +200,9 @@ add_test(function test_internalSaveStats_arraySamples() {
netStatsDb.logAllRecords(function(error, result) {
do_check_eq(error, null);
// Result has one sample more than samples because clear inserts
// an empty sample to keep totalBytes synchronized with netd counters
result.shift();
do_check_eq(result.length, samples);
var success = true;
for (var i = 1; i < samples; i++) {
for (var i = 0; i < samples; i++) {
if (result[i].appId != stats[i].appId ||
result[i].serviceType != stats[i].serviceType ||
!compareNetworks(result[i].network, stats[i].network) ||
@ -231,11 +225,8 @@ add_test(function test_internalSaveStats_arraySamples() {
});
add_test(function test_internalRemoveOldStats() {
clearStore('net_stats_store', function() {
var networks = getNetworks();
netStatsDb.clearStats(networks, function (error, result) {
do_check_eq(error, null);
var network = [networks[0].id, networks[0].type];
var samples = 10;
var stats = [];
@ -272,8 +263,7 @@ add_test(function test_internalRemoveOldStats() {
});
function processSamplesDiff(networks, lastStat, newStat, callback) {
netStatsDb.clearStats(networks, function (error, result){
do_check_eq(error, null);
clearStore('net_stats_store', function() {
netStatsDb.dbNewTxn("net_stats_store", "readwrite", function(txn, store) {
netStatsDb._saveStats(txn, store, lastStat);
}, function(error, result) {
@ -448,29 +438,23 @@ add_test(function test_saveAppStats() {
txBytes: 2234,
isAccumulative: false };
netStatsDb.clearStats(networks, function (error, result) {
do_check_eq(error, null);
clearStore('net_stats_store', function() {
netStatsDb.saveStats(stats, function(error, result) {
do_check_eq(error, null);
netStatsDb.logAllRecords(function(error, result) {
do_check_eq(error, null);
// The clear function clears all records of the datbase but
// inserts a new element for each [appId, connectionId, connectionType]
// record to keep the track of rxTotalBytes / txTotalBytes.
// So at this point, we have two records, one for the appId 0 used in
// past tests and the new one for appId 1
do_check_eq(result.length, 2);
do_check_eq(result[1].appId, stats.appId);
do_check_eq(result[1].serviceType, stats.serviceType);
do_check_true(compareNetworks(result[1].network, network));
do_check_eq(result.length, 1);
do_check_eq(result[0].appId, stats.appId);
do_check_eq(result[0].serviceType, stats.serviceType);
do_check_true(compareNetworks(result[0].network, network));
let timestamp = filterTimestamp(stats.date);
do_check_eq(result[1].timestamp, timestamp);
do_check_eq(result[1].rxBytes, stats.rxBytes);
do_check_eq(result[1].txBytes, stats.txBytes);
do_check_eq(result[1].rxSystemBytes, 0);
do_check_eq(result[1].txSystemBytes, 0);
do_check_eq(result[1].rxTotalBytes, 0);
do_check_eq(result[1].txTotalBytes, 0);
do_check_eq(result[0].timestamp, timestamp);
do_check_eq(result[0].rxBytes, stats.rxBytes);
do_check_eq(result[0].txBytes, stats.txBytes);
do_check_eq(result[0].rxSystemBytes, 0);
do_check_eq(result[0].txSystemBytes, 0);
do_check_eq(result[0].rxTotalBytes, 0);
do_check_eq(result[0].txTotalBytes, 0);
run_next_test();
});
});
@ -490,36 +474,31 @@ add_test(function test_saveServiceStats() {
txBytes: 2234,
isAccumulative: false };
netStatsDb.clearStats(networks, function (error, result) {
do_check_eq(error, null);
clearStore('net_stats_store', function() {
netStatsDb.saveStats(stats, function(error, result) {
do_check_eq(error, null);
netStatsDb.logAllRecords(function(error, result) {
do_check_eq(error, null);
// Again, at this point, we have two records, one for the appId 0 and
// empty serviceType used in past tests and the new one for appId 0 and
// non-empty serviceType.
do_check_eq(result.length, 2);
do_check_eq(result[1].appId, stats.appId);
do_check_eq(result[1].serviceType, stats.serviceType);
do_check_true(compareNetworks(result[1].network, network));
do_check_eq(result.length, 1);
do_check_eq(result[0].appId, stats.appId);
do_check_eq(result[0].serviceType, stats.serviceType);
do_check_true(compareNetworks(result[0].network, network));
let timestamp = filterTimestamp(stats.date);
do_check_eq(result[1].timestamp, timestamp);
do_check_eq(result[1].rxBytes, stats.rxBytes);
do_check_eq(result[1].txBytes, stats.txBytes);
do_check_eq(result[1].rxSystemBytes, 0);
do_check_eq(result[1].txSystemBytes, 0);
do_check_eq(result[1].rxTotalBytes, 0);
do_check_eq(result[1].txTotalBytes, 0);
do_check_eq(result[0].timestamp, timestamp);
do_check_eq(result[0].rxBytes, stats.rxBytes);
do_check_eq(result[0].txBytes, stats.txBytes);
do_check_eq(result[0].rxSystemBytes, 0);
do_check_eq(result[0].txSystemBytes, 0);
do_check_eq(result[0].rxTotalBytes, 0);
do_check_eq(result[0].txTotalBytes, 0);
run_next_test();
});
});
});
});
function prepareFind(network, stats, callback) {
netStatsDb.clearStats(network, function (error, result) {
do_check_eq(error, null);
function prepareFind(stats, callback) {
clearStore('net_stats_store', function() {
netStatsDb.dbNewTxn("net_stats_store", "readwrite", function(txn, store) {
netStatsDb._saveStats(txn, store, stats);
}, function(error, result) {
@ -557,7 +536,7 @@ add_test(function test_find () {
rxTotalBytes: 0, txTotalBytes: 0 });
}
prepareFind(networks[0], stats, function(error, result) {
prepareFind(stats, function(error, result) {
do_check_eq(error, null);
netStatsDb.find(function (error, result) {
do_check_eq(error, null);
@ -601,7 +580,7 @@ add_test(function test_findAppStats () {
rxTotalBytes: 0, txTotalBytes: 0 });
}
prepareFind(networks[0], stats, function(error, result) {
prepareFind(stats, function(error, result) {
do_check_eq(error, null);
netStatsDb.find(function (error, result) {
do_check_eq(error, null);
@ -645,7 +624,7 @@ add_test(function test_findServiceStats () {
rxTotalBytes: 0, txTotalBytes: 0 });
}
prepareFind(networks[0], stats, function(error, result) {
prepareFind(stats, function(error, result) {
do_check_eq(error, null);
netStatsDb.find(function (error, result) {
do_check_eq(error, null);
@ -720,21 +699,14 @@ add_test(function test_saveMultipleAppStats () {
let index = 0;
networks.push(networkMobile);
netStatsDb.clearStats(networks, function (error, result) {
do_check_eq(error, null);
clearStore('net_stats_store', function() {
netStatsDb.saveStats(cached[keys[index]],
function callback(error, result) {
do_check_eq(error, null);
if (index == keys.length - 1) {
netStatsDb.logAllRecords(function(error, result) {
// Again, result has two samples more than expected samples because
// clear inserts one empty sample for each network to keep totalBytes
// synchronized with netd counters. so the first two samples have to
// be discarted.
result.shift();
result.shift();
do_check_eq(error, null);
do_check_eq(result.length, 6);
do_check_eq(result[0].serviceType, serviceType);

View File

@ -778,7 +778,7 @@ function RadioInterfaceLayer() {
} catch(e) {}
let numIfaces = this.numRadioInterfaces;
debug(numIfaces + " interfaces");
if (DEBUG) debug(numIfaces + " interfaces");
this.radioInterfaces = [];
for (let clientId = 0; clientId < numIfaces; clientId++) {
options.clientId = clientId;
@ -1310,7 +1310,7 @@ RadioInterface.prototype = {
// If the value in system property is not valid, use the default one which
// is defined in ril_consts.js.
if (RIL.GECKO_SUPPORTED_NETWORK_TYPES.indexOf(type) < 0) {
this.debug("Unknown network type: " + type);
if (DEBUG) this.debug("Unknown network type: " + type);
supportedNetworkTypes =
RIL.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT.split(",");
break;
@ -1956,7 +1956,6 @@ RadioInterface.prototype = {
// Update lastKnownNetwork
if (message.mcc && message.mnc) {
this._lastKnownNetwork = message.mcc + "-" + message.mnc;
if (DEBUG) this.debug("_lastKnownNetwork: " + this._lastKnownNetwork);
}
// If the voice is unregistered, no need to send RIL:VoiceInfoChanged.
@ -2604,7 +2603,7 @@ RadioInterface.prototype = {
return;
}
if (this._lastNitzMessage) {
debug("SNTP: NITZ available, discard SNTP");
if (DEBUG) debug("SNTP: NITZ available, discard SNTP");
return;
}
gTimeService.set(Date.now() + offset);
@ -2659,7 +2658,6 @@ RadioInterface.prototype = {
// Update lastKnownHomeNetwork.
if (message.mcc && message.mnc) {
this._lastKnownHomeNetwork = message.mcc + "-" + message.mnc;
this.debug("_lastKnownHomeNetwork: " + this._lastKnownHomeNetwork);
}
// If spn becomes available, we should check roaming again.
@ -2815,7 +2813,9 @@ RadioInterface.prototype = {
let isClockAutoUpdateAvailable = this._lastNitzMessage !== null ||
this._sntp.isAvailable();
if (aResult !== isClockAutoUpdateAvailable) {
if (DEBUG) {
debug("Content processes cannot modify 'time.clock.automatic-update.available'. Restore!");
}
// Restore the setting to the current value.
this.setClockAutoUpdateAvailable(isClockAutoUpdateAvailable);
}
@ -3758,8 +3758,12 @@ RadioInterface.prototype = {
},
setupDataCallByType: function(apntype) {
if (DEBUG) this.debug("setupDataCallByType: " + apntype);
let apnSetting = this.apnSettings.byType[apntype];
if (!apnSetting) {
if (DEBUG) {
this.debug("No apn setting for type: " + apntype);
}
return;
}
@ -3798,8 +3802,12 @@ RadioInterface.prototype = {
},
deactivateDataCallByType: function(apntype) {
if (DEBUG) this.debug("deactivateDataCallByType: " + apntype);
let apnSetting = this.apnSettings.byType[apntype];
if (!apnSetting) {
if (DEBUG) {
this.debug("No apn setting for type: " + apntype);
}
return;
}
@ -4100,6 +4108,19 @@ RILNetworkInterface.prototype = {
this.state = datacall.state;
Services.obs.notifyObservers(this,
kNetworkInterfaceStateChangedTopic,
null);
if ((this.state == RIL.GECKO_NETWORK_STATE_UNKNOWN ||
this.state == RIL.GECKO_NETWORK_STATE_DISCONNECTED) &&
this.registeredAsNetworkInterface) {
gNetworkManager.unregisterNetworkInterface(this);
this.registeredAsNetworkInterface = false;
this.cid = null;
this.connectedTypes = [];
}
// In case the data setting changed while the datacall was being started or
// ended, let's re-check the setting and potentially adjust the datacall
// state again.
@ -4108,18 +4129,6 @@ RILNetworkInterface.prototype = {
this.apnSetting.apn)) {
this.radioInterface.updateRILNetworkInterface();
}
Services.obs.notifyObservers(this,
kNetworkInterfaceStateChangedTopic,
null);
if (this.state == RIL.GECKO_NETWORK_STATE_UNKNOWN &&
this.registeredAsNetworkInterface) {
gNetworkManager.unregisterNetworkInterface(this);
this.registeredAsNetworkInterface = false;
this.cid = null;
this.connectedTypes = [];
}
},
receiveDataCallList: function(dataCalls, length) {

View File

@ -3807,7 +3807,9 @@ let RIL = {
},
_processSuppSvcNotification: function(info) {
if (DEBUG) {
debug("handle supp svc notification: " + JSON.stringify(info));
}
let notification = null;
let callIndex = -1;
@ -4969,7 +4971,7 @@ let RIL = {
RIL.initRILState();
RIL[REQUEST_GET_SIM_STATUS] = function(length, options) {
RIL[REQUEST_GET_SIM_STATUS] = function REQUEST_GET_SIM_STATUS(length, options) {
if (options.rilRequestError) {
return;
}
@ -5011,28 +5013,29 @@ RIL[REQUEST_GET_SIM_STATUS] = function(length, options) {
if (DEBUG) debug("iccStatus: " + JSON.stringify(iccStatus));
this._processICCStatus(iccStatus);
};
RIL[REQUEST_ENTER_SIM_PIN] = function(length, options) {
RIL[REQUEST_ENTER_SIM_PIN] = function REQUEST_ENTER_SIM_PIN(length, options) {
this._processEnterAndChangeICCResponses(length, options);
};
RIL[REQUEST_ENTER_SIM_PUK] = function(length, options) {
RIL[REQUEST_ENTER_SIM_PUK] = function REQUEST_ENTER_SIM_PUK(length, options) {
this._processEnterAndChangeICCResponses(length, options);
};
RIL[REQUEST_ENTER_SIM_PIN2] = function(length, options) {
RIL[REQUEST_ENTER_SIM_PIN2] = function REQUEST_ENTER_SIM_PIN2(length, options) {
this._processEnterAndChangeICCResponses(length, options);
};
RIL[REQUEST_ENTER_SIM_PUK2] = function(length, options) {
RIL[REQUEST_ENTER_SIM_PUK2] = function REQUEST_ENTER_SIM_PUK(length, options) {
this._processEnterAndChangeICCResponses(length, options);
};
RIL[REQUEST_CHANGE_SIM_PIN] = function(length, options) {
RIL[REQUEST_CHANGE_SIM_PIN] = function REQUEST_CHANGE_SIM_PIN(length, options) {
this._processEnterAndChangeICCResponses(length, options);
};
RIL[REQUEST_CHANGE_SIM_PIN2] = function(length, options) {
RIL[REQUEST_CHANGE_SIM_PIN2] = function REQUEST_CHANGE_SIM_PIN2(length, options) {
this._processEnterAndChangeICCResponses(length, options);
};
RIL[REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE] = function(length, options) {
RIL[REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE] =
function REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE(length, options) {
this._processEnterAndChangeICCResponses(length, options);
};
RIL[REQUEST_GET_CURRENT_CALLS] = function(length, options) {
RIL[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CALLS(length, options) {
if (options.rilRequestError) {
return;
}
@ -5088,7 +5091,7 @@ RIL[REQUEST_GET_CURRENT_CALLS] = function(length, options) {
}
this._processCalls(calls);
};
RIL[REQUEST_DIAL] = function(length, options) {
RIL[REQUEST_DIAL] = function REQUEST_DIAL(length, options) {
if (options.rilRequestError) {
// The connection is not established yet.
options.callIndex = -1;
@ -5096,7 +5099,7 @@ RIL[REQUEST_DIAL] = function(length, options) {
RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError]);
}
};
RIL[REQUEST_GET_IMSI] = function(length, options) {
RIL[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) {
if (options.rilRequestError) {
return;
}
@ -5110,35 +5113,35 @@ RIL[REQUEST_GET_IMSI] = function(length, options) {
options.imsi = this.iccInfoPrivate.imsi;
this.sendChromeMessage(options);
};
RIL[REQUEST_HANGUP] = function(length, options) {
RIL[REQUEST_HANGUP] = function REQUEST_HANGUP(length, options) {
if (options.rilRequestError) {
return;
}
this.getCurrentCalls();
};
RIL[REQUEST_HANGUP_WAITING_OR_BACKGROUND] = function(length, options) {
RIL[REQUEST_HANGUP_WAITING_OR_BACKGROUND] = function REQUEST_HANGUP_WAITING_OR_BACKGROUND(length, options) {
if (options.rilRequestError) {
return;
}
this.getCurrentCalls();
};
RIL[REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND] = function(length, options) {
RIL[REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND] = function REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND(length, options) {
if (options.rilRequestError) {
return;
}
this.getCurrentCalls();
};
RIL[REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE] = function(length, options) {
RIL[REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE] = function REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE(length, options) {
if (options.rilRequestError) {
return;
}
this.getCurrentCalls();
};
RIL[REQUEST_SWITCH_HOLDING_AND_ACTIVE] = function(length, options) {
RIL[REQUEST_SWITCH_HOLDING_AND_ACTIVE] = function REQUEST_SWITCH_HOLDING_AND_ACTIVE(length, options) {
if (options.rilRequestError) {
return;
}
@ -5148,7 +5151,7 @@ RIL[REQUEST_SWITCH_HOLDING_AND_ACTIVE] = function(length, options) {
// this.getCurrentCalls() helps update the call state actively.
this.getCurrentCalls();
};
RIL[REQUEST_CONFERENCE] = function(length, options) {
RIL[REQUEST_CONFERENCE] = function REQUEST_CONFERENCE(length, options) {
if (options.rilRequestError) {
this._hasConferenceRequest = false;
options = {rilMessageType: "conferenceError",
@ -5159,7 +5162,7 @@ RIL[REQUEST_CONFERENCE] = function(length, options) {
}
};
RIL[REQUEST_UDUB] = null;
RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = function(length, options) {
RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_FAIL_CAUSE(length, options) {
let num = 0;
if (length) {
num = Buf.readInt32();
@ -5175,7 +5178,7 @@ RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = function(length, options) {
options.failCause = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause];
this._handleDisconnectedCall(options);
};
RIL[REQUEST_SIGNAL_STRENGTH] = function(length, options) {
RIL[REQUEST_SIGNAL_STRENGTH] = function REQUEST_SIGNAL_STRENGTH(length, options) {
this._receivedNetworkInfo(NETWORK_INFO_SIGNAL);
if (options.rilRequestError) {
@ -5204,7 +5207,7 @@ RIL[REQUEST_SIGNAL_STRENGTH] = function(length, options) {
this._processSignalStrength(signal);
};
RIL[REQUEST_VOICE_REGISTRATION_STATE] = function(length, options) {
RIL[REQUEST_VOICE_REGISTRATION_STATE] = function REQUEST_VOICE_REGISTRATION_STATE(length, options) {
this._receivedNetworkInfo(NETWORK_INFO_VOICE_REGISTRATION_STATE);
if (options.rilRequestError) {
@ -5225,7 +5228,7 @@ RIL[REQUEST_VOICE_REGISTRATION_STATE] = function(length, options) {
this.cachedDialRequest = null;
}
};
RIL[REQUEST_DATA_REGISTRATION_STATE] = function(length, options) {
RIL[REQUEST_DATA_REGISTRATION_STATE] = function REQUEST_DATA_REGISTRATION_STATE(length, options) {
this._receivedNetworkInfo(NETWORK_INFO_DATA_REGISTRATION_STATE);
if (options.rilRequestError) {
@ -5235,7 +5238,7 @@ RIL[REQUEST_DATA_REGISTRATION_STATE] = function(length, options) {
let state = Buf.readStringList();
this._processDataRegistrationState(state);
};
RIL[REQUEST_OPERATOR] = function(length, options) {
RIL[REQUEST_OPERATOR] = function REQUEST_OPERATOR(length, options) {
this._receivedNetworkInfo(NETWORK_INFO_OPERATOR);
if (options.rilRequestError) {
@ -5246,7 +5249,7 @@ RIL[REQUEST_OPERATOR] = function(length, options) {
if (DEBUG) debug("Operator: " + operatorData);
this._processOperator(operatorData);
};
RIL[REQUEST_RADIO_POWER] = function(length, options) {
RIL[REQUEST_RADIO_POWER] = function REQUEST_RADIO_POWER(length, options) {
if (options.rilMessageType == null) {
// The request was made by ril_worker itself.
if (options.rilRequestError) {
@ -5263,7 +5266,7 @@ RIL[REQUEST_RADIO_POWER] = function(length, options) {
this.sendChromeMessage(options);
};
RIL[REQUEST_DTMF] = null;
RIL[REQUEST_SEND_SMS] = function(length, options) {
RIL[REQUEST_SEND_SMS] = function REQUEST_SEND_SMS(length, options) {
this._processSmsSendResult(length, options);
};
RIL[REQUEST_SEND_SMS_EXPECT_MORE] = null;
@ -5283,7 +5286,7 @@ RIL.readSetupDataCall_v5 = function readSetupDataCall_v5(options) {
return options;
};
RIL[REQUEST_SETUP_DATA_CALL] = function(length, options) {
RIL[REQUEST_SETUP_DATA_CALL] = function REQUEST_SETUP_DATA_CALL(length, options) {
if (options.rilRequestError) {
// On Data Call generic errors, we shall notify caller
this._sendDataCallError(options, options.rilRequestError);
@ -5306,7 +5309,7 @@ RIL[REQUEST_SETUP_DATA_CALL] = function(length, options) {
// how the data call was set up.
this[REQUEST_DATA_CALL_LIST](length, options);
};
RIL[REQUEST_SIM_IO] = function(length, options) {
RIL[REQUEST_SIM_IO] = function REQUEST_SIM_IO(length, options) {
if (!length) {
ICCIOHelper.processICCIOError(options);
return;
@ -5322,7 +5325,7 @@ RIL[REQUEST_SIM_IO] = function(length, options) {
}
ICCIOHelper.processICCIO(options);
};
RIL[REQUEST_SEND_USSD] = function(length, options) {
RIL[REQUEST_SEND_USSD] = function REQUEST_SEND_USSD(length, options) {
if (DEBUG) {
debug("REQUEST_SEND_USSD " + JSON.stringify(options));
}
@ -5330,7 +5333,7 @@ RIL[REQUEST_SEND_USSD] = function(length, options) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
};
RIL[REQUEST_CANCEL_USSD] = function(length, options) {
RIL[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length, options) {
if (DEBUG) {
debug("REQUEST_CANCEL_USSD" + JSON.stringify(options));
}
@ -5339,7 +5342,7 @@ RIL[REQUEST_CANCEL_USSD] = function(length, options) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_CLIR] = function(length, options) {
RIL[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5423,7 +5426,7 @@ RIL[REQUEST_GET_CLIR] = function(length, options) {
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_CLIR] = function(length, options) {
RIL[REQUEST_SET_CLIR] = function REQUEST_SET_CLIR(length, options) {
if (options.rilMessageType == null) {
// The request was made by ril_worker itself automatically. Don't report.
return;
@ -5444,7 +5447,8 @@ RIL[REQUEST_SET_CLIR] = function(length, options) {
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_CALL_FORWARD_STATUS] = function(length, options) {
RIL[REQUEST_QUERY_CALL_FORWARD_STATUS] =
function REQUEST_QUERY_CALL_FORWARD_STATUS(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5483,7 +5487,8 @@ RIL[REQUEST_QUERY_CALL_FORWARD_STATUS] = function(length, options) {
}
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_CALL_FORWARD] = function(length, options) {
RIL[REQUEST_SET_CALL_FORWARD] =
function REQUEST_SET_CALL_FORWARD(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5505,7 +5510,8 @@ RIL[REQUEST_SET_CALL_FORWARD] = function(length, options) {
}
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_CALL_WAITING] = function(length, options) {
RIL[REQUEST_QUERY_CALL_WAITING] =
function REQUEST_QUERY_CALL_WAITING(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5524,7 +5530,7 @@ RIL[REQUEST_QUERY_CALL_WAITING] = function(length, options) {
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_CALL_WAITING] = function(length, options) {
RIL[REQUEST_SET_CALL_WAITING] = function REQUEST_SET_CALL_WAITING(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5540,7 +5546,7 @@ RIL[REQUEST_SET_CALL_WAITING] = function(length, options) {
this.sendChromeMessage(options);
};
RIL[REQUEST_SMS_ACKNOWLEDGE] = null;
RIL[REQUEST_GET_IMEI] = function(length, options) {
RIL[REQUEST_GET_IMEI] = function REQUEST_GET_IMEI(length, options) {
this.IMEI = Buf.readString();
let rilMessageType = options.rilMessageType;
// So far we only send the IMEI back to chrome if it was requested via MMI.
@ -5556,7 +5562,7 @@ RIL[REQUEST_GET_IMEI] = function(length, options) {
options.statusMessage = this.IMEI;
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_IMEISV] = function(length, options) {
RIL[REQUEST_GET_IMEISV] = function REQUEST_GET_IMEISV(length, options) {
if (options.rilRequestError) {
return;
}
@ -5564,7 +5570,7 @@ RIL[REQUEST_GET_IMEISV] = function(length, options) {
this.IMEISV = Buf.readString();
};
RIL[REQUEST_ANSWER] = null;
RIL[REQUEST_DEACTIVATE_DATA_CALL] = function(length, options) {
RIL[REQUEST_DEACTIVATE_DATA_CALL] = function REQUEST_DEACTIVATE_DATA_CALL(length, options) {
if (options.rilRequestError) {
return;
}
@ -5575,7 +5581,7 @@ RIL[REQUEST_DEACTIVATE_DATA_CALL] = function(length, options) {
datacall.rilMessageType = "datacallstatechange";
this.sendChromeMessage(datacall);
};
RIL[REQUEST_QUERY_FACILITY_LOCK] = function(length, options) {
RIL[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILITY_LOCK(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5613,7 +5619,7 @@ RIL[REQUEST_QUERY_FACILITY_LOCK] = function(length, options) {
}
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_FACILITY_LOCK] = function(length, options) {
RIL[REQUEST_SET_FACILITY_LOCK] = function REQUEST_SET_FACILITY_LOCK(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5633,13 +5639,14 @@ RIL[REQUEST_SET_FACILITY_LOCK] = function(length, options) {
}
this.sendChromeMessage(options);
};
RIL[REQUEST_CHANGE_BARRING_PASSWORD] = function(length, options) {
RIL[REQUEST_CHANGE_BARRING_PASSWORD] =
function REQUEST_CHANGE_BARRING_PASSWORD(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
this.sendChromeMessage(options);
};
RIL[REQUEST_SIM_OPEN_CHANNEL] = function(length, options) {
RIL[REQUEST_SIM_OPEN_CHANNEL] = function REQUEST_SIM_OPEN_CHANNEL(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
@ -5650,7 +5657,7 @@ RIL[REQUEST_SIM_OPEN_CHANNEL] = function(length, options) {
if (DEBUG) debug("Setting channel number in options: " + options.channel);
this.sendChromeMessage(options);
};
RIL[REQUEST_SIM_CLOSE_CHANNEL] = function(length, options) {
RIL[REQUEST_SIM_CLOSE_CHANNEL] = function REQUEST_SIM_CLOSE_CHANNEL(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
@ -5660,7 +5667,7 @@ RIL[REQUEST_SIM_CLOSE_CHANNEL] = function(length, options) {
// No return value
this.sendChromeMessage(options);
};
RIL[REQUEST_SIM_ACCESS_CHANNEL] = function(length, options) {
RIL[REQUEST_SIM_ACCESS_CHANNEL] = function REQUEST_SIM_ACCESS_CHANNEL(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
@ -5675,7 +5682,7 @@ RIL[REQUEST_SIM_ACCESS_CHANNEL] = function(length, options) {
}
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function(length, options) {
RIL[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function REQUEST_QUERY_NETWORK_SELECTION_MODE(length, options) {
this._receivedNetworkInfo(NETWORK_INFO_NETWORK_SELECTION_MODE);
if (options.rilRequestError) {
@ -5703,21 +5710,21 @@ RIL[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function(length, options) {
this._sendNetworkInfoMessage(NETWORK_INFO_NETWORK_SELECTION_MODE, options);
}
};
RIL[REQUEST_SET_NETWORK_SELECTION_AUTOMATIC] = function(length, options) {
RIL[REQUEST_SET_NETWORK_SELECTION_AUTOMATIC] = function REQUEST_SET_NETWORK_SELECTION_AUTOMATIC(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_NETWORK_SELECTION_MANUAL] = function(length, options) {
RIL[REQUEST_SET_NETWORK_SELECTION_MANUAL] = function REQUEST_SET_NETWORK_SELECTION_MANUAL(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_AVAILABLE_NETWORKS] = function(length, options) {
RIL[REQUEST_QUERY_AVAILABLE_NETWORKS] = function REQUEST_QUERY_AVAILABLE_NETWORKS(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
} else {
@ -5727,7 +5734,7 @@ RIL[REQUEST_QUERY_AVAILABLE_NETWORKS] = function(length, options) {
};
RIL[REQUEST_DTMF_START] = null;
RIL[REQUEST_DTMF_STOP] = null;
RIL[REQUEST_BASEBAND_VERSION] = function(length, options) {
RIL[REQUEST_BASEBAND_VERSION] = function REQUEST_BASEBAND_VERSION(length, options) {
if (options.rilRequestError) {
return;
}
@ -5735,7 +5742,7 @@ RIL[REQUEST_BASEBAND_VERSION] = function(length, options) {
this.basebandVersion = Buf.readString();
if (DEBUG) debug("Baseband version: " + this.basebandVersion);
};
RIL[REQUEST_SEPARATE_CONNECTION] = function(length, options) {
RIL[REQUEST_SEPARATE_CONNECTION] = function REQUEST_SEPARATE_CONNECTION(length, options) {
if (options.rilRequestError) {
options = {rilMessageType: "conferenceError",
errorName: "removeError",
@ -5746,7 +5753,7 @@ RIL[REQUEST_SEPARATE_CONNECTION] = function(length, options) {
};
RIL[REQUEST_SET_MUTE] = null;
RIL[REQUEST_GET_MUTE] = null;
RIL[REQUEST_QUERY_CLIP] = function(length, options) {
RIL[REQUEST_QUERY_CLIP] = function REQUEST_QUERY_CLIP(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5824,7 +5831,7 @@ RIL.readDataCall_v6 = function(options) {
return options;
};
RIL[REQUEST_DATA_CALL_LIST] = function(length, options) {
RIL[REQUEST_DATA_CALL_LIST] = function REQUEST_DATA_CALL_LIST(length, options) {
if (options.rilRequestError) {
return;
}
@ -5861,7 +5868,7 @@ RIL[REQUEST_OEM_HOOK_RAW] = null;
RIL[REQUEST_OEM_HOOK_STRINGS] = null;
RIL[REQUEST_SCREEN_STATE] = null;
RIL[REQUEST_SET_SUPP_SVC_NOTIFICATION] = null;
RIL[REQUEST_WRITE_SMS_TO_SIM] = function(length, options) {
RIL[REQUEST_WRITE_SMS_TO_SIM] = function REQUEST_WRITE_SMS_TO_SIM(length, options) {
if (options.rilRequestError) {
// `The MS shall return a "protocol error, unspecified" error message if
// the short message cannot be stored in the (U)SIM, and there is other
@ -5881,7 +5888,7 @@ RIL[REQUEST_STK_SEND_ENVELOPE_COMMAND] = null;
RIL[REQUEST_STK_SEND_TERMINAL_RESPONSE] = null;
RIL[REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM] = null;
RIL[REQUEST_EXPLICIT_CALL_TRANSFER] = null;
RIL[REQUEST_SET_PREFERRED_NETWORK_TYPE] = function(length, options) {
RIL[REQUEST_SET_PREFERRED_NETWORK_TYPE] = function REQUEST_SET_PREFERRED_NETWORK_TYPE(length, options) {
if (options.networkType == null) {
// The request was made by ril_worker itself automatically. Don't report.
return;
@ -5895,7 +5902,7 @@ RIL[REQUEST_SET_PREFERRED_NETWORK_TYPE] = function(length, options) {
}
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function(length, options) {
RIL[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function REQUEST_GET_PREFERRED_NETWORK_TYPE(length, options) {
if (options.rilRequestError) {
options.success = false;
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -5916,13 +5923,13 @@ RIL[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function(length, options) {
RIL[REQUEST_GET_NEIGHBORING_CELL_IDS] = null;
RIL[REQUEST_SET_LOCATION_UPDATES] = null;
RIL[REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE] = null;
RIL[REQUEST_CDMA_SET_ROAMING_PREFERENCE] = function(length, options) {
RIL[REQUEST_CDMA_SET_ROAMING_PREFERENCE] = function REQUEST_CDMA_SET_ROAMING_PREFERENCE(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
this.sendChromeMessage(options);
};
RIL[REQUEST_CDMA_QUERY_ROAMING_PREFERENCE] = function(length, options) {
RIL[REQUEST_CDMA_QUERY_ROAMING_PREFERENCE] = function REQUEST_CDMA_QUERY_ROAMING_PREFERENCE(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
} else {
@ -5933,7 +5940,7 @@ RIL[REQUEST_CDMA_QUERY_ROAMING_PREFERENCE] = function(length, options) {
};
RIL[REQUEST_SET_TTY_MODE] = null;
RIL[REQUEST_QUERY_TTY_MODE] = null;
RIL[REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE] = function(length, options) {
RIL[REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE] = function REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
@ -5942,7 +5949,7 @@ RIL[REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE] = function(length, options) {
this.sendChromeMessage(options);
};
RIL[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE] = function(length, options) {
RIL[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE] = function REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendChromeMessage(options);
@ -5956,12 +5963,12 @@ RIL[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE] = function(length, options)
RIL[REQUEST_CDMA_FLASH] = null;
RIL[REQUEST_CDMA_BURST_DTMF] = null;
RIL[REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY] = null;
RIL[REQUEST_CDMA_SEND_SMS] = function(length, options) {
RIL[REQUEST_CDMA_SEND_SMS] = function REQUEST_CDMA_SEND_SMS(length, options) {
this._processSmsSendResult(length, options);
};
RIL[REQUEST_CDMA_SMS_ACKNOWLEDGE] = null;
RIL[REQUEST_GSM_GET_BROADCAST_SMS_CONFIG] = null;
RIL[REQUEST_GSM_SET_BROADCAST_SMS_CONFIG] = function(length, options) {
RIL[REQUEST_GSM_SET_BROADCAST_SMS_CONFIG] = function REQUEST_GSM_SET_BROADCAST_SMS_CONFIG(length, options) {
if (options.rilRequestError == ERROR_SUCCESS) {
this.setSmsBroadcastActivation(true);
}
@ -5970,7 +5977,7 @@ RIL[REQUEST_GSM_SMS_BROADCAST_ACTIVATION] = null;
RIL[REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG] = null;
RIL[REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG] = null;
RIL[REQUEST_CDMA_SMS_BROADCAST_ACTIVATION] = null;
RIL[REQUEST_CDMA_SUBSCRIPTION] = function(length, options) {
RIL[REQUEST_CDMA_SUBSCRIPTION] = function REQUEST_CDMA_SUBSCRIPTION(length, options) {
if (options.rilRequestError) {
return;
}
@ -5987,7 +5994,7 @@ RIL[REQUEST_CDMA_SUBSCRIPTION] = function(length, options) {
};
RIL[REQUEST_CDMA_WRITE_SMS_TO_RUIM] = null;
RIL[REQUEST_CDMA_DELETE_SMS_ON_RUIM] = null;
RIL[REQUEST_DEVICE_IDENTITY] = function(length, options) {
RIL[REQUEST_DEVICE_IDENTITY] = function REQUEST_DEVICE_IDENTITY(length, options) {
if (options.rilRequestError) {
return;
}
@ -6000,7 +6007,7 @@ RIL[REQUEST_DEVICE_IDENTITY] = function(length, options) {
this.ESN = result[2];
this.MEID = result[3];
};
RIL[REQUEST_EXIT_EMERGENCY_CALLBACK_MODE] = function(length, options) {
RIL[REQUEST_EXIT_EMERGENCY_CALLBACK_MODE] = function REQUEST_EXIT_EMERGENCY_CALLBACK_MODE(length, options) {
if (options.internal) {
return;
}
@ -6011,7 +6018,7 @@ RIL[REQUEST_EXIT_EMERGENCY_CALLBACK_MODE] = function(length, options) {
}
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_SMSC_ADDRESS] = function(length, options) {
RIL[REQUEST_GET_SMSC_ADDRESS] = function REQUEST_GET_SMSC_ADDRESS(length, options) {
this.SMSC = options.rilRequestError ? null : Buf.readString();
if (!options || options.rilMessageType !== "getSmscAddress") {
@ -6026,7 +6033,7 @@ RIL[REQUEST_SET_SMSC_ADDRESS] = null;
RIL[REQUEST_REPORT_SMS_MEMORY_STATUS] = null;
RIL[REQUEST_REPORT_STK_SERVICE_IS_RUNNING] = null;
RIL[REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU] = null;
RIL[REQUEST_STK_SEND_ENVELOPE_WITH_STATUS] = function(length, options) {
RIL[REQUEST_STK_SEND_ENVELOPE_WITH_STATUS] = function REQUEST_STK_SEND_ENVELOPE_WITH_STATUS(length, options) {
if (options.rilRequestError) {
this.acknowledgeGsmSms(false, PDU_FCS_UNSPECIFIED);
return;
@ -6052,7 +6059,7 @@ RIL[REQUEST_STK_SEND_ENVELOPE_WITH_STATUS] = function(length, options) {
this.acknowledgeIncomingGsmSmsWithPDU(success, responsePduLen, options);
};
RIL[REQUEST_VOICE_RADIO_TECH] = function(length, options) {
RIL[REQUEST_VOICE_RADIO_TECH] = function REQUEST_VOICE_RADIO_TECH(length, options) {
if (options.rilRequestError) {
if (DEBUG) {
debug("Error when getting voice radio tech: " + options.rilRequestError);
@ -6062,7 +6069,7 @@ RIL[REQUEST_VOICE_RADIO_TECH] = function(length, options) {
let radioTech = Buf.readInt32List();
this._processRadioTech(radioTech[0]);
};
RIL[REQUEST_GET_UNLOCK_RETRY_COUNT] = function(length, options) {
RIL[REQUEST_GET_UNLOCK_RETRY_COUNT] = function REQUEST_GET_UNLOCK_RETRY_COUNT(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
@ -6072,7 +6079,7 @@ RIL[REQUEST_GET_UNLOCK_RETRY_COUNT] = function(length, options) {
};
RIL[RIL_REQUEST_GPRS_ATTACH] = null;
RIL[RIL_REQUEST_GPRS_DETACH] = null;
RIL[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function() {
RIL[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED() {
let radioState = Buf.readInt32();
let newState;
if (radioState == RADIO_STATE_UNAVAILABLE) {
@ -6152,15 +6159,15 @@ RIL[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function() {
}
this.getICCStatus();
};
RIL[UNSOLICITED_RESPONSE_CALL_STATE_CHANGED] = function() {
RIL[UNSOLICITED_RESPONSE_CALL_STATE_CHANGED] = function UNSOLICITED_RESPONSE_CALL_STATE_CHANGED() {
this.getCurrentCalls();
};
RIL[UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED] = function() {
RIL[UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED] = function UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED() {
if (DEBUG) debug("Network state changed, re-requesting phone state and ICC status");
this.getICCStatus();
this.requestNetworkInfo();
};
RIL[UNSOLICITED_RESPONSE_NEW_SMS] = function(length) {
RIL[UNSOLICITED_RESPONSE_NEW_SMS] = function UNSOLICITED_RESPONSE_NEW_SMS(length) {
let [message, result] = GsmPDUHelper.processReceivedSms(length);
if (message) {
@ -6174,11 +6181,11 @@ RIL[UNSOLICITED_RESPONSE_NEW_SMS] = function(length) {
// Not reserved FCS values, send ACK now.
this.acknowledgeGsmSms(result == PDU_FCS_OK, result);
};
RIL[UNSOLICITED_RESPONSE_NEW_SMS_STATUS_REPORT] = function(length) {
RIL[UNSOLICITED_RESPONSE_NEW_SMS_STATUS_REPORT] = function UNSOLICITED_RESPONSE_NEW_SMS_STATUS_REPORT(length) {
let result = this._processSmsStatusReport(length);
this.acknowledgeGsmSms(result == PDU_FCS_OK, result);
};
RIL[UNSOLICITED_RESPONSE_NEW_SMS_ON_SIM] = function(length) {
RIL[UNSOLICITED_RESPONSE_NEW_SMS_ON_SIM] = function UNSOLICITED_RESPONSE_NEW_SMS_ON_SIM(length) {
let recordNumber = Buf.readInt32List()[0];
SimRecordHelper.readSMS(
@ -6194,7 +6201,7 @@ RIL[UNSOLICITED_RESPONSE_NEW_SMS_ON_SIM] = function(length) {
}
});
};
RIL[UNSOLICITED_ON_USSD] = function() {
RIL[UNSOLICITED_ON_USSD] = function UNSOLICITED_ON_USSD() {
let [typeCode, message] = Buf.readStringList();
if (DEBUG) {
debug("On USSD. Type Code: " + typeCode + " Message: " + message);
@ -6206,18 +6213,15 @@ RIL[UNSOLICITED_ON_USSD] = function() {
message: message,
sessionEnded: !this._ussdSession});
};
RIL[UNSOLICITED_NITZ_TIME_RECEIVED] = function() {
RIL[UNSOLICITED_NITZ_TIME_RECEIVED] = function UNSOLICITED_NITZ_TIME_RECEIVED() {
let dateString = Buf.readString();
// The data contained in the NITZ message is
// in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
// for example: 12/02/16,03:36:08-20,00,310410
// See also bug 714352 - Listen for NITZ updates from rild.
// Always print the NITZ info so we can collection what different providers
// send down the pipe (see bug XXX).
// TODO once data is collected, add in |if (DEBUG)|
debug("DateTimeZone string " + dateString);
if (DEBUG) debug("DateTimeZone string " + dateString);
let now = Date.now();
@ -6247,17 +6251,17 @@ RIL[UNSOLICITED_NITZ_TIME_RECEIVED] = function() {
receiveTimeInMS: now});
};
RIL[UNSOLICITED_SIGNAL_STRENGTH] = function(length) {
RIL[UNSOLICITED_SIGNAL_STRENGTH] = function UNSOLICITED_SIGNAL_STRENGTH(length) {
this[REQUEST_SIGNAL_STRENGTH](length, {rilRequestError: ERROR_SUCCESS});
};
RIL[UNSOLICITED_DATA_CALL_LIST_CHANGED] = function(length) {
RIL[UNSOLICITED_DATA_CALL_LIST_CHANGED] = function UNSOLICITED_DATA_CALL_LIST_CHANGED(length) {
if (RILQUIRKS_V5_LEGACY) {
this.getDataCallList();
return;
}
this[REQUEST_DATA_CALL_LIST](length, {rilRequestError: ERROR_SUCCESS});
};
RIL[UNSOLICITED_SUPP_SVC_NOTIFICATION] = function(length) {
RIL[UNSOLICITED_SUPP_SVC_NOTIFICATION] = function UNSOLICITED_SUPP_SVC_NOTIFICATION(length) {
let info = {};
info.notificationType = Buf.readInt32();
info.code = Buf.readInt32();
@ -6268,19 +6272,19 @@ RIL[UNSOLICITED_SUPP_SVC_NOTIFICATION] = function(length) {
this._processSuppSvcNotification(info);
};
RIL[UNSOLICITED_STK_SESSION_END] = function() {
RIL[UNSOLICITED_STK_SESSION_END] = function UNSOLICITED_STK_SESSION_END() {
this.sendChromeMessage({rilMessageType: "stksessionend"});
};
RIL[UNSOLICITED_STK_PROACTIVE_COMMAND] = function() {
RIL[UNSOLICITED_STK_PROACTIVE_COMMAND] = function UNSOLICITED_STK_PROACTIVE_COMMAND() {
this.processStkProactiveCommand();
};
RIL[UNSOLICITED_STK_EVENT_NOTIFY] = function() {
RIL[UNSOLICITED_STK_EVENT_NOTIFY] = function UNSOLICITED_STK_EVENT_NOTIFY() {
this.processStkProactiveCommand();
};
RIL[UNSOLICITED_STK_CALL_SETUP] = null;
RIL[UNSOLICITED_SIM_SMS_STORAGE_FULL] = null;
RIL[UNSOLICITED_SIM_REFRESH] = null;
RIL[UNSOLICITED_CALL_RING] = function() {
RIL[UNSOLICITED_CALL_RING] = function UNSOLICITED_CALL_RING() {
let info = {rilMessageType: "callRing"};
let isCDMA = false; //XXX TODO hard-code this for now
if (isCDMA) {
@ -6295,10 +6299,10 @@ RIL[UNSOLICITED_CALL_RING] = function() {
// dispatch DOM events etc.
this.sendChromeMessage(info);
};
RIL[UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED] = function() {
RIL[UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED] = function UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED() {
this.getICCStatus();
};
RIL[UNSOLICITED_RESPONSE_CDMA_NEW_SMS] = function(length) {
RIL[UNSOLICITED_RESPONSE_CDMA_NEW_SMS] = function UNSOLICITED_RESPONSE_CDMA_NEW_SMS(length) {
let [message, result] = CdmaPDUHelper.processReceivedSms(length);
if (message) {
@ -6318,7 +6322,7 @@ RIL[UNSOLICITED_RESPONSE_CDMA_NEW_SMS] = function(length) {
// Not reserved FCS values, send ACK now.
this.acknowledgeCdmaSms(result == PDU_FCS_OK, result);
};
RIL[UNSOLICITED_RESPONSE_NEW_BROADCAST_SMS] = function(length) {
RIL[UNSOLICITED_RESPONSE_NEW_BROADCAST_SMS] = function UNSOLICITED_RESPONSE_NEW_BROADCAST_SMS(length) {
let message;
try {
message = GsmPDUHelper.readCbMessage(Buf.readInt32());
@ -6339,10 +6343,10 @@ RIL[UNSOLICITED_RESPONSE_NEW_BROADCAST_SMS] = function(length) {
};
RIL[UNSOLICITED_CDMA_RUIM_SMS_STORAGE_FULL] = null;
RIL[UNSOLICITED_RESTRICTED_STATE_CHANGED] = null;
RIL[UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE] = function() {
RIL[UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE] = function UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE() {
this._handleChangedEmergencyCbMode(true);
};
RIL[UNSOLICITED_CDMA_CALL_WAITING] = function(length) {
RIL[UNSOLICITED_CDMA_CALL_WAITING] = function UNSOLICITED_CDMA_CALL_WAITING(length) {
let call = {};
call.number = Buf.readString();
call.numberPresentation = Buf.readInt32();
@ -6355,12 +6359,12 @@ RIL[UNSOLICITED_CDMA_CALL_WAITING] = function(length) {
this.sendChromeMessage({rilMessageType: "cdmaCallWaiting",
number: call.number});
};
RIL[UNSOLICITED_CDMA_OTA_PROVISION_STATUS] = function() {
RIL[UNSOLICITED_CDMA_OTA_PROVISION_STATUS] = function UNSOLICITED_CDMA_OTA_PROVISION_STATUS() {
let status = Buf.readInt32List()[0];
this.sendChromeMessage({rilMessageType: "otastatuschange",
status: status});
};
RIL[UNSOLICITED_CDMA_INFO_REC] = function(length) {
RIL[UNSOLICITED_CDMA_INFO_REC] = function UNSOLICITED_CDMA_INFO_REC(length) {
let record = CdmaPDUHelper.decodeInformationRecord();
record.rilMessageType = "cdma-info-rec-received";
this.sendChromeMessage(record);
@ -6368,10 +6372,10 @@ RIL[UNSOLICITED_CDMA_INFO_REC] = function(length) {
RIL[UNSOLICITED_OEM_HOOK_RAW] = null;
RIL[UNSOLICITED_RINGBACK_TONE] = null;
RIL[UNSOLICITED_RESEND_INCALL_MUTE] = null;
RIL[UNSOLICITED_EXIT_EMERGENCY_CALLBACK_MODE] = function() {
RIL[UNSOLICITED_EXIT_EMERGENCY_CALLBACK_MODE] = function UNSOLICITED_EXIT_EMERGENCY_CALLBACK_MODE() {
this._handleChangedEmergencyCbMode(false);
};
RIL[UNSOLICITED_RIL_CONNECTED] = function(length) {
RIL[UNSOLICITED_RIL_CONNECTED] = function UNSOLICITED_RIL_CONNECTED(length) {
// Prevent response id collision between UNSOLICITED_RIL_CONNECTED and
// UNSOLICITED_VOICE_RADIO_TECH_CHANGED for Akami on gingerbread branch.
if (!length) {
@ -13900,5 +13904,5 @@ onmessage = function onmessage(event) {
};
onerror = function onerror(event) {
debug("RIL Worker error" + event.message + "\n");
if (DEBUG) debug("RIL Worker error" + event.message + "\n");
};

View File

@ -53,7 +53,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
{
if (mBuffer &&
(mBuffer->IsImmutable() || mBuffer->GetSize() != aSize)) {
mBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mBuffer);
mBuffer = nullptr;
}

View File

@ -389,6 +389,7 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
NS_WARNING("failed to forward Layers transaction");
}
mForwarder->ForceRemoveTexturesIfNecessary();
mPhase = PHASE_NONE;
// this may result in Layers being deleted, which results in

View File

@ -103,7 +103,7 @@ void
ImageClientSingle::FlushAllImages(bool aExceptFront)
{
if (!aExceptFront && mFrontBuffer) {
mFrontBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mFrontBuffer);
mFrontBuffer = nullptr;
}
}
@ -112,11 +112,11 @@ void
ImageClientBuffered::FlushAllImages(bool aExceptFront)
{
if (!aExceptFront && mFrontBuffer) {
mFrontBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mFrontBuffer);
mFrontBuffer = nullptr;
}
if (mBackBuffer) {
mBackBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mBackBuffer);
mBackBuffer = nullptr;
}
}
@ -147,7 +147,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
}
if (mFrontBuffer) {
mFrontBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mFrontBuffer);
}
mFrontBuffer = texture;
if (!AddTextureClient(texture)) {
@ -164,7 +164,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
}
if (mFrontBuffer && mFrontBuffer->IsImmutable()) {
mFrontBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mFrontBuffer);
mFrontBuffer = nullptr;
}
@ -207,7 +207,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
gfx::IntSize size = gfx::IntSize(image->GetSize().width, image->GetSize().height);
if (mFrontBuffer) {
mFrontBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mFrontBuffer);
mFrontBuffer = nullptr;
}
@ -228,7 +228,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
if (mFrontBuffer &&
(mFrontBuffer->IsImmutable() || mFrontBuffer->GetSize() != size)) {
mFrontBuffer->ForceRemove();
GetForwarder()->AddForceRemovingTexture(mFrontBuffer);
mFrontBuffer = nullptr;
}

View File

@ -386,10 +386,10 @@ public:
ISurfaceAllocator* GetAllocator() const;
ipc::Shmem& GetShmem() { return mShmem; }
mozilla::ipc::Shmem& GetShmem() { return mShmem; }
protected:
ipc::Shmem mShmem;
mozilla::ipc::Shmem mShmem;
RefPtr<ISurfaceAllocator> mAllocator;
bool mAllocated;
};

View File

@ -1228,7 +1228,7 @@ bool FlingAnimation::Sample(FrameMetrics& aFrameMetrics,
mX.AdjustDisplacement(cssOffset.x, overscroll.x,
aFrameMetrics.GetDisableScrollingX()),
mY.AdjustDisplacement(cssOffset.y, overscroll.y,
aFrameMetrics.GetDisableScrollingX())
aFrameMetrics.GetDisableScrollingY())
));
return true;

View File

@ -13,6 +13,7 @@
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator
#include "mozilla/layers/LayersTypes.h" // for LayersBackend
#include "mozilla/layers/TextureClient.h" // for TextureClient
#include "nsRegion.h" // for nsIntRegion
struct nsIntPoint;
@ -27,10 +28,8 @@ class SurfaceDescriptor;
class SurfaceDescriptorTiles;
class ThebesBufferData;
class DeprecatedTextureClient;
class TextureClient;
class BasicTiledLayerBuffer;
class PTextureChild;
class TextureClientData;
/**
* A transaction is a set of changes that happenned on the content side, that
@ -162,6 +161,29 @@ public:
*/
virtual void RemoveTexture(TextureClient* aTexture) = 0;
/**
* Forcibly remove texture data from TextureClient
* after a tansaction with Compositor.
*/
virtual void AddForceRemovingTexture(TextureClient* aClient)
{
if (aClient) {
mForceRemovingTextures.AppendElement(aClient);
}
}
/**
* Forcibly remove texture data from TextureClient
* This function needs to be called after a tansaction with Compositor.
*/
virtual void ForceRemoveTexturesIfNecessary()
{
for (uint32_t i = 0; i < mForceRemovingTextures.Length(); i++) {
mForceRemovingTextures[i]->ForceRemove();
}
mForceRemovingTextures.Clear();
}
/**
* Tell the CompositableHost on the compositor side what texture to use for
* the next composition.
@ -219,6 +241,7 @@ public:
protected:
TextureFactoryIdentifier mTextureFactoryIdentifier;
bool mMultiProcess;
nsTArray<RefPtr<TextureClient> > mForceRemovingTextures;
};
} // namespace

View File

@ -443,12 +443,27 @@ ImageBridgeChild::BeginTransaction()
mTxn->Begin();
}
class MOZ_STACK_CLASS AutoForceRemoveTextures
{
public:
AutoForceRemoveTextures(ImageBridgeChild* aImageBridge)
: mImageBridge(aImageBridge) {}
~AutoForceRemoveTextures()
{
mImageBridge->ForceRemoveTexturesIfNecessary();
}
private:
ImageBridgeChild* mImageBridge;
};
void
ImageBridgeChild::EndTransaction()
{
MOZ_ASSERT(!mTxn->Finished(), "forgot BeginTransaction?");
AutoEndTransaction _(mTxn);
AutoForceRemoveTextures autoForceRemoveTextures(this);
if (mTxn->IsEmpty()) {
return;

View File

@ -301,33 +301,19 @@
"dom/imptests/editing/conformancetest/test_runtest.html":"takes too long",
"dom/media/tests/mochitest/test_dataChannel_basicAudio.html":"bug 908473",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicVideo.html":"",
"dom/media/tests/mochitest/test_dataChannel_noOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_addCandidateInHaveLocalOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicAudio.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicVideo.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug822674.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug825703.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug827843.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug834153.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug835370.html":"",
"dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html":"",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html":"",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html":"",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html":"",
"dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html":"",
"dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html":"",
"dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicAudio.html":"Bug 962984, test fail on b2g debug build",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_dataChannel_basicVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_basicVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_bug827843.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/ipc/test_ipc.html":"nested ipc not working",
"dom/network/tests/test_networkstats_basics.html":"Will be fixed in bug 858005",
"dom/permission/tests/test_permission_basics.html":"https not working, bug 907770",

View File

@ -288,33 +288,17 @@
"dom/imptests/editing/conformancetest/test_runtest.html":"takes too long",
"dom/media/tests/mochitest/test_dataChannel_basicAudio.html":"bug 908473",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicDataOnly.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicVideo.html":"",
"dom/media/tests/mochitest/test_dataChannel_noOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_addCandidateInHaveLocalOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicAudio.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html":"",
"dom/media/tests/mochitest/test_peerConnection_basicVideo.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug822674.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug825703.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug827843.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug834153.html":"",
"dom/media/tests/mochitest/test_peerConnection_bug835370.html":"",
"dom/media/tests/mochitest/test_peerConnection_errorCallbacks.html":"",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html":"",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html":"",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html":"",
"dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInHaveLocalOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_setLocalAnswerInStable.html":"",
"dom/media/tests/mochitest/test_peerConnection_setLocalOfferInHaveRemoteOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_setRemoteAnswerInStable.html":"",
"dom/media/tests/mochitest/test_peerConnection_setRemoteOfferInHaveLocalOffer.html":"",
"dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html":"",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_dataChannel_basicAudioVideoCombined.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_dataChannel_basicVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_basicAudioVideoCombined.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_basicVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_bug827843.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html":"Bug 960442, video support for WebRTC is disabled on b2g",
"dom/media/tests/ipc/test_ipc.html":"nested ipc not working",
"dom/permission/tests/test_permission_basics.html":"https not working, bug 907770",

View File

@ -70,6 +70,8 @@ if CONFIG['TARGET_CPU'] == 'x86_64':
'ComplexTextInputPanel.mm',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../shared',