Merge m-c to inbound. a=merge

This commit is contained in:
Ryan VanderMeulen 2014-07-18 10:25:14 -04:00
commit 77b1c14c1a
52 changed files with 465 additions and 323 deletions

View File

@ -351,7 +351,7 @@ let AdbController = {
// Check if we have a remote debugging session going on. If so, we won't
// disable adb even if the screen is locked.
let isDebugging = USBRemoteDebugger.isDebugging;
let isDebugging = RemoteDebugger.isDebugging;
if (this.DEBUG) {
this.debug("isDebugging=" + isDebugging);
}
@ -432,78 +432,45 @@ SettingsListener.observe("lockscreen.enabled", false,
AdbController.setLockscreenEnabled.bind(AdbController));
#endif
(function() {
// Track these separately here so we can determine the correct value for the
// pref "devtools.debugger.remote-enabled", which is true when either mode of
// using DevTools is enabled.
let devtoolsUSB = false;
let devtoolsWiFi = false;
// Keep the old setting to not break people that won't have updated
// gaia and gecko.
SettingsListener.observe('devtools.debugger.remote-enabled', false,
function(value) {
devtoolsUSB = value;
Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
devtoolsUSB || devtoolsWiFi);
// This preference is consulted during startup
Services.prefs.savePrefFile(null);
try {
value ? USBRemoteDebugger.start() : USBRemoteDebugger.stop();
} catch(e) {
dump("Error while initializing USB devtools: "
+ e + "\n" + e.stack + "\n");
}
// Keep the old setting to not break people that won't have updated
// gaia and gecko.
SettingsListener.observe('devtools.debugger.remote-enabled', false, function(value) {
Services.prefs.setBoolPref('devtools.debugger.remote-enabled', value);
// This preference is consulted during startup
Services.prefs.savePrefFile(null);
try {
value ? RemoteDebugger.start() : RemoteDebugger.stop();
} catch(e) {
dump("Error while initializing devtools: " + e + "\n" + e.stack + "\n");
}
#ifdef MOZ_WIDGET_GONK
AdbController.setRemoteDebuggerState(value);
AdbController.setRemoteDebuggerState(value);
#endif
});
});
SettingsListener.observe('debugger.remote-mode', false, function(value) {
if (['disabled', 'adb-only', 'adb-devtools'].indexOf(value) == -1) {
dump('Illegal value for debugger.remote-mode: ' + value + '\n');
return;
}
SettingsListener.observe('debugger.remote-mode', false, function(value) {
if (['disabled', 'adb-only', 'adb-devtools'].indexOf(value) == -1) {
dump('Illegal value for debugger.remote-mode: ' + value + '\n');
return;
}
devtoolsUSB = value == 'adb-devtools';
Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
devtoolsUSB || devtoolsWiFi);
// This preference is consulted during startup
Services.prefs.savePrefFile(null);
Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
value == 'adb-devtools');
// This preference is consulted during startup
Services.prefs.savePrefFile(null);
try {
(value == 'adb-devtools') ? USBRemoteDebugger.start()
: USBRemoteDebugger.stop();
} catch(e) {
dump("Error while initializing USB devtools: "
+ e + "\n" + e.stack + "\n");
}
try {
(value == 'adb-devtools') ? RemoteDebugger.start()
: RemoteDebugger.stop();
} catch(e) {
dump("Error while initializing devtools: " + e + "\n" + e.stack + "\n");
}
#ifdef MOZ_WIDGET_GONK
AdbController.setRemoteDebuggerState(value != 'disabled');
AdbController.setRemoteDebuggerState(value != 'disabled');
#endif
});
SettingsListener.observe('devtools.remote.wifi.enabled', false,
function(value) {
devtoolsWiFi = value;
Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
devtoolsUSB || devtoolsWiFi);
// Allow remote debugging on non-local interfaces when WiFi debug is enabled
// TODO: Bug 1034411: Lock down to WiFi interface, instead of all interfaces
Services.prefs.setBoolPref('devtools.debugger.force-local', !value);
// This preference is consulted during startup
Services.prefs.savePrefFile(null);
try {
value ? WiFiRemoteDebugger.start() : WiFiRemoteDebugger.stop();
} catch(e) {
dump("Error while initializing WiFi devtools: "
+ e + "\n" + e.stack + "\n");
}
});
})();
});
// =================== Device Storage ====================
SettingsListener.observe('device.storage.writable.name', 'sdcard', function(value) {
@ -690,9 +657,6 @@ let settingsToObserve = {
defaultValue: false
},
'devtools.eventlooplag.threshold': 100,
'devtools.remote.wifi.visible': {
resetToPref: true
},
'dom.mozApps.use_reviewer_certs': false,
'layers.draw-borders': false,
'layers.draw-tile-borders': false,

View File

@ -56,16 +56,6 @@ XPCOMUtils.defineLazyGetter(this, 'DebuggerServer', function() {
return DebuggerServer;
});
XPCOMUtils.defineLazyGetter(this, 'devtools', function() {
const { devtools } =
Cu.import('resource://gre/modules/devtools/Loader.jsm', {});
return devtools;
});
XPCOMUtils.defineLazyGetter(this, 'discovery', function() {
return devtools.require('devtools/toolkit/discovery/discovery');
});
XPCOMUtils.defineLazyGetter(this, "ppmm", function() {
return Cc["@mozilla.org/parentprocessmessagemanager;1"]
.getService(Ci.nsIMessageListenerManager);
@ -816,11 +806,10 @@ let IndexedDBPromptHelper = {
}
}
function RemoteDebugger() {}
RemoteDebugger.prototype = {
let RemoteDebugger = {
_promptDone: false,
_promptAnswer: false,
_listener: null,
_running: false,
prompt: function debugger_prompt() {
this._promptDone = false;
@ -841,146 +830,108 @@ RemoteDebugger.prototype = {
this._promptDone = true;
},
initServer: function() {
if (DebuggerServer.initialized) {
return;
}
// Ask for remote connections.
DebuggerServer.init(this.prompt.bind(this));
// /!\ Be careful when adding a new actor, especially global actors.
// Any new global actor will be exposed and returned by the root actor.
// Add Firefox-specific actors, but prevent tab actors to be loaded in
// the parent process, unless we enable certified apps debugging.
let restrictPrivileges = Services.prefs.getBoolPref("devtools.debugger.forbid-certified-apps");
DebuggerServer.addBrowserActors("navigator:browser", restrictPrivileges);
/**
* Construct a root actor appropriate for use in a server running in B2G.
* The returned root actor respects the factories registered with
* DebuggerServer.addGlobalActor only if certified apps debugging is on,
* otherwise we used an explicit limited list of global actors
*
* * @param connection DebuggerServerConnection
* The conection to the client.
*/
DebuggerServer.createRootActor = function createRootActor(connection)
{
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
let parameters = {
// We do not expose browser tab actors yet,
// but we still have to define tabList.getList(),
// otherwise, client won't be able to fetch global actors
// from listTabs request!
tabList: {
getList: function() {
return promise.resolve([]);
}
},
// Use an explicit global actor list to prevent exposing
// unexpected actors
globalActorFactories: restrictPrivileges ? {
webappsActor: DebuggerServer.globalActorFactories.webappsActor,
deviceActor: DebuggerServer.globalActorFactories.deviceActor,
} : DebuggerServer.globalActorFactories
};
let { RootActor } = devtools.require("devtools/server/actors/root");
let root = new RootActor(connection, parameters);
root.applicationType = "operating-system";
return root;
};
#ifdef MOZ_WIDGET_GONK
DebuggerServer.on("connectionchange", function() {
AdbController.updateState();
});
#endif
}
};
let USBRemoteDebugger = new RemoteDebugger();
Object.defineProperty(USBRemoteDebugger, "isDebugging", {
get: function() {
if (!this._listener) {
get isDebugging() {
if (!this._running) {
return false;
}
return DebuggerServer._connections &&
Object.keys(DebuggerServer._connections).length > 0;
},
// Start the debugger server.
start: function debugger_start() {
if (this._running) {
return;
}
if (!DebuggerServer.initialized) {
// Ask for remote connections.
DebuggerServer.init(this.prompt.bind(this));
// /!\ Be careful when adding a new actor, especially global actors.
// Any new global actor will be exposed and returned by the root actor.
// Add Firefox-specific actors, but prevent tab actors to be loaded in
// the parent process, unless we enable certified apps debugging.
let restrictPrivileges = Services.prefs.getBoolPref("devtools.debugger.forbid-certified-apps");
DebuggerServer.addBrowserActors("navigator:browser", restrictPrivileges);
/**
* Construct a root actor appropriate for use in a server running in B2G.
* The returned root actor respects the factories registered with
* DebuggerServer.addGlobalActor only if certified apps debugging is on,
* otherwise we used an explicit limited list of global actors
*
* * @param connection DebuggerServerConnection
* The conection to the client.
*/
DebuggerServer.createRootActor = function createRootActor(connection)
{
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
let parameters = {
// We do not expose browser tab actors yet,
// but we still have to define tabList.getList(),
// otherwise, client won't be able to fetch global actors
// from listTabs request!
tabList: {
getList: function() {
return promise.resolve([]);
}
},
// Use an explicit global actor list to prevent exposing
// unexpected actors
globalActorFactories: restrictPrivileges ? {
webappsActor: DebuggerServer.globalActorFactories.webappsActor,
deviceActor: DebuggerServer.globalActorFactories.deviceActor,
} : DebuggerServer.globalActorFactories
};
let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
let { RootActor } = devtools.require("devtools/server/actors/root");
let root = new RootActor(connection, parameters);
root.applicationType = "operating-system";
return root;
};
#ifdef MOZ_WIDGET_GONK
DebuggerServer.on("connectionchange", function() {
AdbController.updateState();
});
#endif
}
let path = Services.prefs.getCharPref("devtools.debugger.unix-domain-socket") ||
"/data/local/debugger-socket";
try {
DebuggerServer.openListener(path);
// Temporary event, until bug 942756 lands and offers a way to know
// when the server is up and running.
Services.obs.notifyObservers(null, 'debugger-server-started', null);
this._running = true;
} catch (e) {
dump('Unable to start debugger server: ' + e + '\n');
}
},
stop: function debugger_stop() {
if (!this._running) {
return;
}
if (!DebuggerServer.initialized) {
// Can this really happen if we are running?
this._running = false;
return;
}
try {
DebuggerServer.closeAllListeners();
} catch (e) {
dump('Unable to stop debugger server: ' + e + '\n');
}
this._running = false;
}
});
USBRemoteDebugger.start = function() {
if (this._listener) {
return;
}
this.initServer();
let portOrPath =
Services.prefs.getCharPref("devtools.debugger.unix-domain-socket") ||
"/data/local/debugger-socket";
try {
debug("Starting USB debugger on " + portOrPath);
this._listener = DebuggerServer.openListener(portOrPath);
// Temporary event, until bug 942756 lands and offers a way to know
// when the server is up and running.
Services.obs.notifyObservers(null, 'debugger-server-started', null);
} catch (e) {
debug('Unable to start USB debugger server: ' + e);
}
};
USBRemoteDebugger.stop = function() {
if (!this._listener) {
return;
}
try {
this._listener.close();
this._listener = null;
} catch (e) {
debug('Unable to stop USB debugger server: ' + e);
}
};
let WiFiRemoteDebugger = new RemoteDebugger();
WiFiRemoteDebugger.start = function() {
if (this._listener) {
return;
}
this.initServer();
try {
debug("Starting WiFi debugger");
this._listener = DebuggerServer.openListener(-1);
let port = this._listener.port;
debug("Started WiFi debugger on " + port);
discovery.addService("devtools", { port: port });
} catch (e) {
debug('Unable to start WiFi debugger server: ' + e);
}
};
WiFiRemoteDebugger.stop = function() {
if (!this._listener) {
return;
}
try {
discovery.removeService("devtools");
this._listener.close();
this._listener = null;
} catch (e) {
debug('Unable to stop WiFi debugger server: ' + e);
}
};
}
let KeyboardHelper = {
handleEvent: function keyboard_handleEvent(detail) {
@ -1273,7 +1224,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
// We must set the size in KB, and keep a bit of free space.
let size = Math.floor(stats.totalBytes / 1024) - 1024;
Services.prefs.setIntPref("browser.cache.disk.capacity", size);
}) ()
})();
#endif
// Calling this observer will cause a shutdown an a profile reset.

View File

@ -33,12 +33,66 @@ function log(msg) {
//dump('ProcessGlobal: ' + msg + '\n');
}
const gFactoryResetFile = "/persist/__post_reset_cmd__";
function ProcessGlobal() {}
ProcessGlobal.prototype = {
classID: Components.ID('{1a94c87a-5ece-4d11-91e1-d29c29f21b28}'),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
wipeDir: function(path) {
log("wipeDir " + path);
let dir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
dir.initWithPath(path);
if (!dir.exists() || !dir.isDirectory()) {
return;
}
let entries = dir.directoryEntries;
while (entries.hasMoreElements()) {
let file = entries.getNext().QueryInterface(Ci.nsIFile);
log("Deleting " + file.path);
try {
file.remove(true);
} catch(e) {}
}
},
processWipeFile: function(text) {
log("processWipeFile " + text);
let lines = text.split("\n");
lines.forEach((line) => {
log(line);
let params = line.split(" ");
if (params[0] == "wipe") {
this.wipeDir(params[1]);
}
});
},
cleanupAfterFactoryReset: function() {
log("cleanupAfterWipe start");
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
file.initWithPath(gFactoryResetFile);
if (!file.exists()) {
debug("Nothing to wipe.")
return;
}
Cu.import("resource://gre/modules/osfile.jsm");
let promise = OS.File.read(gFactoryResetFile);
promise.then(
(array) => {
file.remove(false);
let decoder = new TextDecoder();
this.processWipeFile(decoder.decode(array));
}
);
log("cleanupAfterWipe end.");
},
observe: function pg_observe(subject, topic, data) {
switch (topic) {
case 'app-startup': {
@ -52,6 +106,8 @@ ProcessGlobal.prototype = {
ppmm.addMessageListener("getProfD", function(message) {
return Services.dirsvc.get("ProfD", Ci.nsIFile).path;
});
this.cleanupAfterFactoryReset();
}
break;
}

View File

@ -48,6 +48,9 @@ let librecovery = (function() {
FotaUpdateStatus.ptr)
};
})();
const gFactoryResetFile = "/persist/__post_reset_cmd__";
#endif
function RecoveryService() {}
@ -62,16 +65,44 @@ RecoveryService.prototype = {
classDescription: "B2G Recovery Service"
}),
factoryReset: function RS_factoryReset() {
factoryReset: function RS_factoryReset(reason) {
#ifdef MOZ_WIDGET_GONK
// If this succeeds, then the device reboots and this never returns
if (librecovery.factoryReset() != 0) {
log("Error: Factory reset failed. Trying again after clearing cache.");
function doReset() {
// If this succeeds, then the device reboots and this never returns
if (librecovery.factoryReset() != 0) {
log("Error: Factory reset failed. Trying again after clearing cache.");
}
let cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Ci.nsICacheStorageService);
cache.clear();
if (librecovery.factoryReset() != 0) {
log("Error: Factory reset failed again");
}
}
var cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
cache.clear();
if (librecovery.factoryReset() != 0) {
log("Error: Factory reset failed again");
log("factoryReset " + reason);
if (reason == "wipe") {
let volumeService = Cc["@mozilla.org/telephony/volume-service;1"]
.getService(Ci.nsIVolumeService);
let volNames = volumeService.getVolumeNames();
log("Found " + volNames.length + " volumes");
let text = "";
for (let i = 0; i < volNames.length; i++) {
let name = volNames.queryElementAt(i, Ci.nsISupportsString);
let volume = volumeService.getVolumeByName(name.data);
log("Got volume: " + name.data + " at " + volume.mountPoint);
text += "wipe " + volume.mountPoint + "\n";
}
Cu.import("resource://gre/modules/osfile.jsm");
let encoder = new TextEncoder();
let array = encoder.encode(text);
let promise = OS.File.writeAtomic(gFactoryResetFile, array,
{ tmpPath: gFactoryResetFile + ".tmp" });
promise.then(doReset);
} else {
doReset();
}
#endif
throw Cr.NS_ERROR_FAILURE;

View File

@ -19,13 +19,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="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="227354333a185180b85471f2cc6abfb029e44718"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -17,10 +17,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="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->
@ -128,10 +128,10 @@
<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="197cd9492b9fadaa915c5daf36ff557f8f4a8d1c"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="421d09bea0feda3934813f0f411d898f08108770"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="683623c76338dccd65e698bfb5c4cfee8808d799"/>
<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="9f28c4faea3b2f01db227b2467b08aeba96d9bec"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2cd3c7277621902b3749797eaaab618c4c80a58b"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
<project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
</manifest>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>

View File

@ -19,13 +19,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="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="227354333a185180b85471f2cc6abfb029e44718"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -17,10 +17,10 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->
@ -143,7 +143,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="bbf7212289fc8311e43f9d11e10788e310d36a08"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2cd3c7277621902b3749797eaaab618c4c80a58b"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="ce18b47b4a4f93a581d672bbd5cb6d12fe796ca9"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "4d18ecb3653e80055af734c17f35b2abd8fd2a19",
"revision": "72a7f5cea568a34d5aa9e221a4cc546de856cace",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,12 +17,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="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<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="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>

View File

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

View File

@ -17,10 +17,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="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->
@ -127,7 +127,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2cd3c7277621902b3749797eaaab618c4c80a58b"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>

View File

@ -17,12 +17,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="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
<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="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
<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

@ -5021,6 +5021,9 @@ dnl enable once PeerConnection lands
MOZ_SRTP=1
AC_DEFINE(MOZ_SCTP)
AC_DEFINE(MOZ_SRTP)
if test -n "$MOZ_X11"; then
MOZ_WEBRTC_X11_LIBS="-lXext -lXdamage -lXfixes -lXcomposite"
fi
else
MOZ_SYNTH_PICO=
fi
@ -5032,6 +5035,7 @@ AC_SUBST(MOZ_PEERCONNECTION)
AC_SUBST(MOZ_WEBRTC_ASSERT_ALWAYS)
AC_SUBST(MOZ_SCTP)
AC_SUBST(MOZ_SRTP)
AC_SUBST(MOZ_WEBRTC_X11_LIBS)
dnl Use integers over floats for audio on B2G and Android, because audio
dnl backends for those platforms don't support floats.
@ -8122,7 +8126,7 @@ if test "$MOZ_TREE_CAIRO"; then
MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
if test "$MOZ_X11"; then
MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXext -lXdamage -lXfixes -lXcomposite -lXrender"
MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
fi
CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h

View File

@ -13,9 +13,9 @@
#include "nsWrapperCache.h"
#include "nsPluginTags.h"
#include "nsPIDOMWindow.h"
#include "nsMimeTypeArray.h"
class nsPluginElement;
class nsMimeType;
class nsPluginArray MOZ_FINAL : public nsIObserver,
public nsSupportsWeakReference,

View File

@ -1998,7 +1998,6 @@ addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject',
notflattened=True)
addExternalIface('MozTreeColumn', nativeType='nsITreeColumn',
headerFile='nsITreeColumns.h')
addExternalIface('MozVoicemailStatus')
addExternalIface('MozWakeLockListener', headerFile='nsIDOMWakeLockListener.h')
addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
addExternalIface('nsIBrowserDOMWindow', nativeType='nsIBrowserDOMWindow',

View File

@ -29,6 +29,7 @@
#include "mozilla/Scoped.h"
#include "mozilla/Services.h"
#include "nsArrayUtils.h"
#include "nsAutoPtr.h"
#include "nsGlobalWindow.h"
#include "nsServiceManagerUtils.h"
@ -3346,7 +3347,19 @@ nsDOMDeviceStorage::GetOrderedVolumeNames(
#ifdef MOZ_WIDGET_GONK
nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID);
if (vs) {
vs->GetVolumeNames(aVolumeNames);
nsCOMPtr<nsIArray> volNames;
vs->GetVolumeNames(getter_AddRefs(volNames));
uint32_t length = -1;
volNames->GetLength(&length);
for (uint32_t i = 0; i < length; i++) {
nsCOMPtr<nsISupportsString> str = do_QueryElementAt(volNames, i);
if (str) {
nsAutoString s;
if (NS_SUCCEEDED(str->GetData(s)) && !s.IsEmpty()) {
aVolumeNames.AppendElement(s);
}
}
}
// If the volume sdcard exists, then we want it to be first.

View File

@ -4,9 +4,9 @@
MARIONETTE_TIMEOUT = 30000;
MARIONETTE_HEAD_JS = "icc_header.js";
// Emulator's hard coded IMSI: 310260000000000
let testCases = [
// mvno type, mvno data, request success, expected result
// Emulator's hard coded IMSI: 310260000000000
["imsi", "3102600", true, true ],
// x and X means skip the comparison.
["imsi", "31026xx0", true, true ],
@ -17,11 +17,18 @@ let testCases = [
["imsi", "310260000000000", true, true ],
["imsi", "310260000000000123", true, false ],
["imsi", "", false, "InvalidParameter"],
// Emulator's hard coded SPN: Android
["spn", "Android", true, true ],
["spn", "", false, "InvalidParameter"],
["spn", "OneTwoThree", true, false ],
// mvno type gid is not supported yet.
["gid", "A1", false, "ModeNotSupported"]
// Emulator's hard coded GID1: 5a4d
["gid", "", false, "InvalidParameter"],
["gid", "A1", true, false ],
["gid", "5A", true, true ],
["gid", "5a", true, true ],
["gid", "5a4d", true, true ],
["gid", "5A4D", true, true ],
["gid", "5a4d6c", true, false ]
];
function matchMvno(mvnoType, mvnoData, success, expectedResult) {

View File

@ -27,7 +27,7 @@ let sessionTokens = [];
function testNfcNotEnabledError() {
log('testNfcNotEnabledError');
toggleNFC(true)
.then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(registerAndFireOnpeerready)
.then(() => toggleNFC(false))
.then(() => sendNDEFExpectError(nfcPeers[0], 'NfcNotEnabledError'))
@ -45,10 +45,10 @@ function testNfcNotEnabledError() {
function testNfcBadSessionIdError() {
log('testNfcBadSessionIdError');
toggleNFC(true)
.then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(registerAndFireOnpeerready)
.then(() => emulator.deactivate())
.then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => NCI.deactivate())
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(registerAndFireOnpeerready)
// we have 2 peers in nfcPeers array, peer0 has old/invalid session token
.then(() => sendNDEFExpectError(nfcPeers[0], 'NfcBadSessionIdError'))
@ -65,7 +65,7 @@ function testNfcBadSessionIdError() {
function testNfcConnectError() {
log('testNfcConnectError');
toggleNFC(true)
.then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(registerAndFireOnpeerready)
.then(() => connectToNFCTagExpectError(sessionTokens[0],
'NDEF',
@ -83,7 +83,7 @@ function testNfcConnectError() {
function testNoErrorInTechMsg() {
log('testNoErrorInTechMsg');
toggleNFC(true)
.then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(setTechDiscoveredHandler)
.then(setAndFireTechLostHandler)
.then(() => toggleNFC(false))
@ -203,7 +203,7 @@ function setAndFireTechLostHandler() {
techLostHandler);
// triggers tech-lost
emulator.deactivate();
NCI.deactivate();
return deferred.promise;
}

View File

@ -78,9 +78,9 @@ PowerManager::Reboot(ErrorResult& aRv)
}
void
PowerManager::FactoryReset()
PowerManager::FactoryReset(mozilla::dom::FactoryResetReason& aReason)
{
hal::FactoryReset();
hal::FactoryReset(aReason);
}
void

View File

@ -12,6 +12,7 @@
#include "nsWeakReference.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
#include "mozilla/dom/MozPowerManagerBinding.h"
class nsPIDOMWindow;
@ -45,7 +46,7 @@ public:
}
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
void Reboot(ErrorResult& aRv);
void FactoryReset();
void FactoryReset(mozilla::dom::FactoryResetReason& aReason);
void PowerOff(ErrorResult& aRv);
void AddWakeLockListener(nsIDOMMozWakeLockListener* aListener);
void RemoveWakeLockListener(nsIDOMMozWakeLockListener* aListener);

View File

@ -273,16 +273,9 @@ function VoicemailStatus(clientId) {
this.serviceId = clientId;
}
VoicemailStatus.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozVoicemailStatus]),
QueryInterface: XPCOMUtils.generateQI([]),
classID: VOICEMAILSTATUS_CID,
classInfo: XPCOMUtils.generateCI({
classID: VOICEMAILSTATUS_CID,
classDescription: "VoicemailStatus",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMMozVoicemailStatus]
}),
// nsIDOMMozVoicemailStatus
contractID: "@mozilla.org/voicemailstatus;1",
serviceId: -1,
hasMessages: false,

View File

@ -2321,6 +2321,27 @@ RadioInterface.prototype = {
}
message.result = spn == message.mvnoData;
break;
case "gid":
this.workerMessenger.send("getGID1", null, (function(response) {
let gid = response.gid1;
let mvnoDataLength = message.mvnoData.length;
if (!gid) {
message.errorMsg = RIL.GECKO_ERROR_GENERIC_FAILURE;
} else if (mvnoDataLength > gid.length) {
message.result = false;
} else {
message.result =
gid.substring(0, mvnoDataLength).toLowerCase() ==
message.mvnoData.toLowerCase();
}
target.sendAsyncMessage("RIL:MatchMvno", {
clientId: this.clientId,
data: message
});
}).bind(this));
return;
default:
message.errorMsg = RIL.GECKO_ERROR_MODE_NOT_SUPPORTED;
}

View File

@ -18,8 +18,10 @@ contract @mozilla.org/ril;1 {2d831c8d-6017-435b-a80c-e5d422810cea}
category profile-after-change RadioInterfaceLayer @mozilla.org/ril;1
# RILContentHelper.js
component {5467f2eb-e214-43ea-9b89-67711241ec8e} RILContentHelper.js
component {472816e1-1fd6-4405-996c-806f9ea68174} RILContentHelper.js
component {08a71987-408c-44ff-93fd-177c0a85c3dd} RILContentHelper.js
contract @mozilla.org/voicemailstatus;1 {5467f2eb-e214-43ea-9b89-67711241ec8e}
contract @mozilla.org/ril/content-helper;1 {472816e1-1fd6-4405-996c-806f9ea68174}
contract @mozilla.org/dom/icccardlock-error;1 {08a71987-408c-44ff-93fd-177c0a85c3dd}
category profile-after-change RILContentHelper @mozilla.org/ril/content-helper;1

View File

@ -6,13 +6,9 @@
#include "nsIVolume.idl"
#include "nsIVolumeMountLock.idl"
%{C++
#include "nsTArray.h"
#include "nsString.h"
%}
[ref] native nsStringTArrayRef(nsTArray<nsString>);
interface nsIArray;
[scriptable, uuid(a3b110cd-74f2-43cb-84c6-2a87713f2774)]
[scriptable, uuid(cab99ab4-542e-4387-bd40-db6ef30e4f5f)]
interface nsIVolumeService : nsISupports
{
nsIVolume getVolumeByName(in DOMString volName);
@ -23,7 +19,7 @@ interface nsIVolumeService : nsISupports
nsIVolumeMountLock createMountLock(in DOMString volName);
[noscript] void getVolumeNames(in nsStringTArrayRef aVolNames);
nsIArray getVolumeNames();
/* for test case only to simulate sdcard insertion/removal */
void createFakeVolume(in DOMString name, in DOMString path);

View File

@ -12,9 +12,11 @@
#include "nsCOMPtr.h"
#include "nsDependentSubstring.h"
#include "nsIDOMWakeLockListener.h"
#include "nsIMutableArray.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsIPowerManagerService.h"
#include "nsISupportsPrimitives.h"
#include "nsISupportsUtils.h"
#include "nsIVolume.h"
#include "nsIVolumeService.h"
@ -256,17 +258,34 @@ nsVolumeService::CreateOrGetVolumeByPath(const nsAString& aPath, nsIVolume** aRe
}
NS_IMETHODIMP
nsVolumeService::GetVolumeNames(nsTArray<nsString>& aVolNames)
nsVolumeService::GetVolumeNames(nsIArray** aVolNames)
{
NS_ENSURE_ARG_POINTER(aVolNames);
MonitorAutoLock autoLock(mArrayMonitor);
*aVolNames = nullptr;
nsresult rv;
nsCOMPtr<nsIMutableArray> volNames =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsVolume::Array::size_type numVolumes = mVolumeArray.Length();
nsVolume::Array::index_type volIndex;
for (volIndex = 0; volIndex < numVolumes; volIndex++) {
nsRefPtr<nsVolume> vol = mVolumeArray[volIndex];
aVolNames.AppendElement(vol->Name());
nsCOMPtr<nsISupportsString> isupportsString =
do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = isupportsString->SetData(vol->Name());
NS_ENSURE_SUCCESS(rv, rv);
rv = volNames->AppendElement(isupportsString, false);
NS_ENSURE_SUCCESS(rv, rv);
}
NS_ADDREF(*aVolNames = volNames);
return NS_OK;
}

View File

@ -502,6 +502,7 @@ this.ICC_EF_UST = 0x6f38; // For USIM
this.ICC_EF_ADN = 0x6f3a;
this.ICC_EF_FDN = 0x6f3b;
this.ICC_EF_SMS = 0x6f3c;
this.ICC_EF_GID1 = 0x6f3e;
this.ICC_EF_MSISDN = 0x6f40;
this.ICC_EF_CBMI = 0x6f45;
this.ICC_EF_SPN = 0x6f46;
@ -1232,6 +1233,7 @@ this.GECKO_ICC_SERVICES = {
PLMNSEL: 7,
MSISDN: 9,
CBMI: 14,
GID1: 15,
SPN: 17,
SDN: 18,
DATA_DOWNLOAD_SMS_CB: 25,
@ -1250,6 +1252,7 @@ this.GECKO_ICC_SERVICES = {
BDN: 6,
CBMI: 15,
CBMIR: 16,
GID1: 17,
SPN: 19,
MSISDN: 21,
DATA_DOWNLOAD_SMS_PP: 28,

View File

@ -1019,6 +1019,14 @@ RilObject.prototype = {
Buf.sendParcel();
},
/**
* Retrieve ICC's GID1 field.
*/
getGID1: function(options) {
options.gid1 = this.iccInfoPrivate.gid1;
this.sendChromeMessage(options);
},
/**
* Read UICC Phonebook contacts.
*
@ -11862,6 +11870,7 @@ ICCFileHelperObject.prototype = {
case ICC_EF_CBMIR:
case ICC_EF_OPL:
case ICC_EF_PNN:
case ICC_EF_GID1:
return EF_PATH_MF_SIM + EF_PATH_DF_GSM;
default:
return null;
@ -11887,6 +11896,7 @@ ICCFileHelperObject.prototype = {
case ICC_EF_OPL:
case ICC_EF_PNN:
case ICC_EF_SMS:
case ICC_EF_GID1:
return EF_PATH_MF_SIM + EF_PATH_ADF_USIM;
default:
// The file ids in USIM phone book entries are decided by the
@ -13031,6 +13041,13 @@ SimRecordHelperObject.prototype = {
if (DEBUG) this.context.debug("OPL: OPL is not available");
}
if (ICCUtilsHelper.isICCServiceAvailable("GID1")) {
if (DEBUG) this.context.debug("GID1: GID1 is available");
this.readGID1();
} else {
if (DEBUG) this.context.debug("GID1: GID1 is not available");
}
if (ICCUtilsHelper.isICCServiceAvailable("CBMI")) {
this.readCBMI();
} else {
@ -13622,6 +13639,23 @@ SimRecordHelperObject.prototype = {
onerror: onerror
});
},
readGID1: function() {
function callback() {
let Buf = this.context.Buf;
let RIL = this.context.RIL;
RIL.iccInfoPrivate.gid1 = Buf.readString();
if (DEBUG) {
this.context.debug("GID1: " + RIL.iccInfoPrivate.gid1);
}
}
this.context.ICCIOHelper.loadTransparentEF({
fileId: ICC_EF_GID1,
callback: callback.bind(this)
});
},
};
function RuimRecordHelperObject(aContext) {

View File

@ -717,6 +717,8 @@ var interfaceNamesInGlobalScope =
{name: "MozVoicemail", b2g: true, pref: "dom.voicemail.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozVoicemailEvent", b2g: true, pref: "dom.voicemail.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozVoicemailStatus", b2g: true, pref: "dom.voicemail.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "MozWakeLock", b2g: true, pref: "dom.wakelock.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -8,10 +8,11 @@
#include "mozilla/dom/MozVoicemailBinding.h"
#include "mozilla/dom/MozVoicemailEvent.h"
#include "nsIDOMMozVoicemailStatus.h"
#include "mozilla/dom/MozVoicemailStatusBinding.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "nsContentUtils.h"
#include "nsDOMClassInfo.h"
#include "nsServiceManagerUtils.h"
@ -100,7 +101,7 @@ Voicemail::PassedOrDefaultServiceId(const Optional<uint32_t>& aServiceId,
// MozVoicemail WebIDL
already_AddRefed<nsIDOMMozVoicemailStatus>
already_AddRefed<MozVoicemailStatus>
Voicemail::GetStatus(const Optional<uint32_t>& aServiceId,
ErrorResult& aRv) const
{
@ -114,14 +115,20 @@ Voicemail::GetStatus(const Optional<uint32_t>& aServiceId,
aRv.Throw(NS_ERROR_INVALID_ARG);
return nullptr;
}
nsCOMPtr<nsIDOMMozVoicemailStatus> status;
nsresult rv = mProvider->GetVoicemailStatus(id, getter_AddRefs(status));
JSContext *cx = nsContentUtils::GetCurrentJSContext();
JS::Rooted<JS::Value> status(cx);
nsresult rv = mProvider->GetVoicemailStatus(id, &status);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return nullptr;
}
return status.forget();
if (!status.isObject()) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
JS::Rooted<JSObject*> statusObj(cx, &status.toObject());
nsRefPtr<MozVoicemailStatus> res = new MozVoicemailStatus(statusObj, GetParentObject());
return res.forget();
}
void
@ -167,12 +174,16 @@ Voicemail::GetDisplayName(const Optional<uint32_t>& aServiceId, nsString& aDispl
// nsIVoicemailListener
NS_IMETHODIMP
Voicemail::NotifyStatusChanged(nsIDOMMozVoicemailStatus* aStatus)
Voicemail::NotifyStatusChanged(JS::HandleValue aStatus)
{
MozVoicemailEventInit init;
init.mBubbles = false;
init.mCancelable = false;
init.mStatus = aStatus;
if (aStatus.isObject()) {
JSContext *cx = nsContentUtils::GetCurrentJSContext();
JS::Rooted<JSObject*> statusObj(cx, &aStatus.toObject());
init.mStatus = new MozVoicemailStatus(statusObj, GetParentObject());
}
nsRefPtr<MozVoicemailEvent> event =
MozVoicemailEvent::Constructor(this, NS_LITERAL_STRING("statuschanged"), init);

View File

@ -16,11 +16,12 @@ class JSObject;
struct JSContext;
class nsPIDOMWindow;
class nsIDOMMozVoicemailStatus;
namespace mozilla {
namespace dom {
class MozVoicemailStatus;
class Voicemail MOZ_FINAL : public DOMEventTargetHelper
{
/**
@ -50,7 +51,7 @@ public:
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
already_AddRefed<nsIDOMMozVoicemailStatus>
already_AddRefed<MozVoicemailStatus>
GetStatus(const Optional<uint32_t>& aServiceId, ErrorResult& aRv) const;
void

View File

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPIDL_SOURCES += [
'nsIDOMMozVoicemailStatus.idl',
'nsIVoicemailProvider.idl',
]

View File

@ -4,8 +4,6 @@
#include "nsISupports.idl"
interface nsIDOMMozVoicemailStatus;
[scriptable, uuid(214b0963-da48-4859-a56c-f065a90e0403)]
interface nsIVoicemailListener : nsISupports
{
@ -15,7 +13,7 @@ interface nsIVoicemailListener : nsISupports
* @param status
* The new voicemail status
*/
void notifyStatusChanged(in nsIDOMMozVoicemailStatus status);
void notifyStatusChanged(in jsval status);
};
/**
@ -35,7 +33,7 @@ interface nsIVoicemailProvider : nsISupports
void registerVoicemailMsg(in nsIVoicemailListener listener);
void unregisterVoicemailMsg(in nsIVoicemailListener listener);
nsIDOMMozVoicemailStatus getVoicemailStatus(in unsigned long clientId);
jsval getVoicemailStatus(in unsigned long clientId);
DOMString getVoicemailNumber(in unsigned long clientId);
DOMString getVoicemailDisplayName(in unsigned long clientId);
};

View File

@ -5,6 +5,16 @@
interface MozWakeLockListener;
/**
* The reason for the factory reset.
* "normal" : simple factory reset.
* "wipe" : will also attempt to wipe all user storage areas.
*/
enum FactoryResetReason {
"normal",
"wipe"
};
/**
* This interface implements navigator.mozPower
*/
@ -14,7 +24,7 @@ interface MozPowerManager
void powerOff();
[Throws]
void reboot();
void factoryReset();
void factoryReset(optional FactoryResetReason reason = "normal");
/**
* The listeners are notified when a resource changes its lock state to:

View File

@ -4,9 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// nsIDOMMozVoicemailStatus
interface MozVoicemailStatus;
[Pref="dom.voicemail.enabled"]
interface MozVoicemail : EventTarget
{

View File

@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
interface MozVoicemailStatus;
[Constructor(DOMString type, optional MozVoicemailEventInit eventInitDict), Pref="dom.voicemail.enabled"]
interface MozVoicemailEvent : Event

View File

@ -4,10 +4,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
[JSImplementation="@mozilla.org/voicemailstatus;1",
Pref="dom.voicemail.enabled"]
[scriptable, uuid(efd352af-9eee-48dc-8e92-4d4fdbc89ecb)]
interface nsIDOMMozVoicemailStatus : nsISupports
interface MozVoicemailStatus
{
readonly attribute unsigned long serviceId;

View File

@ -14,7 +14,7 @@ enum ConnectionStatus {
"associated",
"connected",
"disconnected",
"wps-timeout",
"wps-timedout",
"wps-failed",
"wps-overlapped",
"connectingfailed"

View File

@ -590,6 +590,7 @@ if CONFIG['MOZ_B2G_RIL']:
'MozMobileConnectionInfo.webidl',
'MozMobileNetworkInfo.webidl',
'MozVoicemail.webidl',
'MozVoicemailStatus.webidl'
]
if CONFIG['MOZ_NFC']:

View File

@ -1049,6 +1049,7 @@ var WifiManager = (function() {
manager.stopSupplicantCallback = (function () {
wifiCommand.stopSupplicant(function (status) {
wifiCommand.closeSupplicantConnection(function() {
manager.connectToSupplicant = false;
manager.state = "UNINITIALIZED";
netUtil.disableInterface(manager.ifname, function (ok) {
unloadDriver(WIFI_FIRMWARE_STATION, callback);
@ -1062,6 +1063,11 @@ var WifiManager = (function() {
}).bind(this);
createWaitForTerminateEventTimer(terminateEventCallback);
// We are going to terminate the connection between wpa_supplicant.
// Stop the polling timer immediately to prevent connection info update
// command blocking in control thread until socket timeout.
notify("stopconnectioninfotimer");
wifiCommand.terminateSupplicant(function (ok) {
manager.connectionDropped(function () {
});
@ -1195,7 +1201,7 @@ var WifiManager = (function() {
function hasValidProperty(name) {
return ((name in config) &&
config[name] != null &&
(["password", "wep_key0", "psk"].indexOf(name) !== -1 ||
(["password", "wep_key0", "psk"].indexOf(name) === -1 ||
config[name] !== '*'));
}
@ -2329,6 +2335,10 @@ function WifiWorker() {
self._fireEvent("stationinfoupdate", { station: this.station });
};
WifiManager.onstopconnectioninfotimer = function() {
self._stopConnectionInfoTimer();
};
// Read the 'wifi.enabled' setting in order to start with a known
// value at boot time. The handle() will be called after reading.
//

View File

@ -1205,10 +1205,10 @@ GetFMBandSettings(FMRadioCountry aCountry) {
return settings;
}
void FactoryReset()
void FactoryReset(mozilla::dom::FactoryResetReason& aReason)
{
AssertMainThread();
PROXY_IF_SANDBOXED(FactoryReset());
PROXY_IF_SANDBOXED(FactoryReset(aReason));
}
void

View File

@ -14,6 +14,7 @@
#include "mozilla/Types.h"
#include "nsTArray.h"
#include "prlog.h"
#include "mozilla/dom/MozPowerManagerBinding.h"
#include "mozilla/dom/battery/Types.h"
#include "mozilla/dom/network/Types.h"
#include "mozilla/dom/power/Types.h"
@ -575,7 +576,7 @@ void StartForceQuitWatchdog(hal::ShutdownMode aMode, int32_t aTimeoutSecs);
/**
* Perform Factory Reset to wipe out all user data.
*/
void FactoryReset();
void FactoryReset(mozilla::dom::FactoryResetReason& aReason);
/**
* Start monitoring the status of gamepads attached to the system.

View File

@ -11,7 +11,7 @@ namespace mozilla {
namespace hal_impl {
void
FactoryReset()
FactoryReset(mozilla::dom::FactoryResetReason&)
{}
} // namespace hal_impl

View File

@ -105,6 +105,7 @@
using namespace mozilla;
using namespace mozilla::hal;
using namespace mozilla::dom;
namespace mozilla {
namespace hal_impl {
@ -1691,7 +1692,7 @@ SetCurrentThreadPriority(ThreadPriority aThreadPriority)
}
void
FactoryReset()
FactoryReset(FactoryResetReason& aReason)
{
nsCOMPtr<nsIRecoveryService> recoveryService =
do_GetService("@mozilla.org/recovery-service;1");
@ -1700,7 +1701,11 @@ FactoryReset()
return;
}
recoveryService->FactoryReset();
if (aReason == FactoryResetReason::Wipe) {
recoveryService->FactoryReset("wipe");
} else {
recoveryService->FactoryReset("normal");
}
}
} // hal_impl

View File

@ -4,7 +4,7 @@
#include "nsISupports.idl"
[scriptable, uuid(acb93ff8-aa6d-4bc8-bedd-2a6a3b802a74)]
[scriptable, uuid(bc24fb33-a0c1-49ca-aa43-05f167e02fb6)]
interface nsIRecoveryService : nsISupports
{
/**
@ -21,7 +21,7 @@ interface nsIRecoveryService : nsISupports
*
* @throws NS_ERROR_FAILURE when rebooting into recovery fails for some reason.
*/
void factoryReset();
void factoryReset(in string reason);
/**
* Use recovery to install an OTA update.zip. If this call is

View File

@ -159,7 +159,7 @@ parent:
sync GetCurrentSwitchState(SwitchDevice aDevice)
returns (SwitchState aState);
FactoryReset();
FactoryReset(nsString aReason);
child:
NotifySensorChange(SensorData aSensorData);

View File

@ -426,9 +426,13 @@ CancelFMRadioSeek()
}
void
FactoryReset()
FactoryReset(FactoryResetReason& aReason)
{
Hal()->SendFactoryReset();
if (aReason == FactoryResetReason::Normal) {
Hal()->SendFactoryReset(NS_LITERAL_STRING("normal"));
} else if (aReason == FactoryResetReason::Wipe) {
Hal()->SendFactoryReset(NS_LITERAL_STRING("wipe"));
}
}
void
@ -841,12 +845,23 @@ public:
}
virtual bool
RecvFactoryReset()
RecvFactoryReset(const nsString& aReason) MOZ_OVERRIDE
{
if (!AssertAppProcessPermission(this, "power")) {
return false;
}
hal::FactoryReset();
FactoryResetReason reason = FactoryResetReason::Normal;
if (aReason.EqualsLiteral("normal")) {
reason = FactoryResetReason::Normal;
} else if (aReason.EqualsLiteral("wipe")) {
reason = FactoryResetReason::Wipe;
} else {
// Invalid factory reset reason. That should never happen.
return false;
}
hal::FactoryReset(reason);
return true;
}

View File

@ -6,6 +6,7 @@ LIBS = \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NSS_LIBS) \
$(MOZ_WEBRTC_X11_LIBS) \
$(REALTIME_LIBS) \
$(DEPTH)/xpcom/glue/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
$(DEPTH)/media/mtransport/standalone/$(LIB_PREFIX)mtransport_s.$(LIB_SUFFIX) \

View File

@ -654,10 +654,6 @@ pref("devtools.dump.emit", false);
pref("devtools.discovery.log", false);
// Disable scanning for DevTools devices via WiFi
pref("devtools.remote.wifi.scan", false);
// Hide UI options for controlling device visibility over WiFi
// N.B.: This does not set whether the device can be discovered via WiFi, only
// whether the UI control to make such a choice is shown to the user
pref("devtools.remote.wifi.visible", false);
// view source
pref("view_source.syntax_highlight", true);

View File

@ -51,6 +51,7 @@ EXTRA_DSO_LDOPTS += \
$(MOZ_JS_LIBS) \
$(NSS_LIBS) \
$(MOZ_CAIRO_OSLIBS) \
$(MOZ_WEBRTC_X11_LIBS) \
$(MOZ_APP_EXTRA_LIBS) \
$(SQLITE_LIBS) \
$(NULL)

View File

@ -12,6 +12,7 @@ support-files =
[test_addon_path_service.js]
[test_asyncBlocklistLoad.js]
[test_DeferredSave.js]
[test_XPIcancel.js]
[test_metadata_update.js]
[test_openh264.js]
run-if = appname == "firefox"
[test_XPIcancel.js]