This commit is contained in:
Phil Ringnalda 2014-11-02 09:03:04 -08:00
Родитель 7de4cd4e03 4e5bb3fe07
Коммит c0265bde5c
17 изменённых файлов: 100 добавлений и 106 удалений

Просмотреть файл

@ -8,6 +8,8 @@
// This file is only loaded on Gonk to manage ADB state
Components.utils.import("resource://gre/modules/FileUtils.jsm");
const DEBUG = false;
var debug = function(str) {
dump("AdbController: " + str + "\n");
@ -177,6 +179,34 @@ let AdbController = {
// This means that the pref doesn't exist. Which is fine. We just leave
// enableAdb alone.
}
// Check wakelock to prevent adb from disconnecting when phone is locked
let lockFile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
lockFile.initWithPath('/sys/power/wake_lock');
if(lockFile.exists()) {
let foStream = Cc["@mozilla.org/network/file-input-stream;1"]
.createInstance(Ci.nsIFileInputStream);
let coStream = Cc["@mozilla.org/intl/converter-input-stream;1"]
.createInstance(Ci.nsIConverterInputStream);
let str = {};
foStream.init(lockFile, FileUtils.MODE_RDONLY, 0, 0);
coStream.init(foStream, "UTF-8", 0, 0);
coStream.readString(-1, str);
coStream.close();
foStream.close();
let wakeLockContents = str.value.replace(/\n/, "");
let wakeLockList = wakeLockContents.split(" ");
if (wakeLockList.indexOf("adb") >= 0) {
enableAdb = true;
useDisableAdbTimer = false;
DEBUG && debug("Keeping ADB enabled as ADB wakelock is present.");
} else {
DEBUG && debug("ADB wakelock not found.");
}
} else {
DEBUG && debug("Wake_lock file not found.");
}
DEBUG && debug("updateState: enableAdb = " + enableAdb +
" remoteDebuggerEnabled = " + this.remoteDebuggerEnabled +
" lockEnabled = " + this.lockEnabled +

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5964f1339f37e7595aff7de7512b8529bc640b76"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c2c55870de22d596de4f41612c0b44090f90ebad"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="45c54a55e31758f7e54e5eafe0d01d387f35897a"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

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

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5964f1339f37e7595aff7de7512b8529bc640b76"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c2c55870de22d596de4f41612c0b44090f90ebad"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="45c54a55e31758f7e54e5eafe0d01d387f35897a"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="28be739bcdcbc9eb91c0bdbff1f7d3eab717969b"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5964f1339f37e7595aff7de7512b8529bc640b76"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c2c55870de22d596de4f41612c0b44090f90ebad"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="45c54a55e31758f7e54e5eafe0d01d387f35897a"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

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

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5964f1339f37e7595aff7de7512b8529bc640b76"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c2c55870de22d596de4f41612c0b44090f90ebad"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="45c54a55e31758f7e54e5eafe0d01d387f35897a"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5964f1339f37e7595aff7de7512b8529bc640b76"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c2c55870de22d596de4f41612c0b44090f90ebad"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="45c54a55e31758f7e54e5eafe0d01d387f35897a"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="28be739bcdcbc9eb91c0bdbff1f7d3eab717969b"/>

Просмотреть файл

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "d5eb693006aeee6ba6021d15e0e8d03a3dd23b2e",
"revision": "3e44ef6e1c5a0cc496aa9b85486fdfe2c849c153",
"repo_path": "/integration/gaia-central"
}

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5964f1339f37e7595aff7de7512b8529bc640b76"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c2c55870de22d596de4f41612c0b44090f90ebad"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="45c54a55e31758f7e54e5eafe0d01d387f35897a"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="28be739bcdcbc9eb91c0bdbff1f7d3eab717969b"/>

Просмотреть файл

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

Просмотреть файл

@ -45,7 +45,8 @@ const RILCONTENTHELPER_CID =
const RIL_IPC_MSG_NAMES = [
"RIL:CardStateChanged",
"RIL:IccInfoChanged",
"RIL:CardLockResult",
"RIL:GetCardLockResult",
"RIL:SetUnlockCardLockResult",
"RIL:CardLockRetryCount",
"RIL:StkCommand",
"RIL:StkSessionEnd",
@ -74,30 +75,6 @@ XPCOMUtils.defineLazyGetter(this, "gNumRadioInterfaces", function() {
return Services.prefs.getIntPref(kPrefRilNumRadioInterfaces);
});
function MobileIccCardLockResult(options) {
this.lockType = options.lockType;
this.enabled = options.enabled;
this.retryCount = options.retryCount;
this.success = options.success;
}
MobileIccCardLockResult.prototype = {
__exposedProps__ : {lockType: 'r',
enabled: 'r',
retryCount: 'r',
success: 'r'}
};
function MobileIccCardLockRetryCount(options) {
this.lockType = options.lockType;
this.retryCount = options.retryCount;
this.success = options.success;
}
MobileIccCardLockRetryCount.prototype = {
__exposedProps__ : {lockType: 'r',
retryCount: 'r',
success: 'r'}
};
function IccInfo() {}
IccInfo.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIIccInfo]),
@ -332,6 +309,8 @@ RILContentHelper.prototype = {
}
let request = Services.DOMRequest.createRequest(window);
let requestId = this.getRequestId(request);
this._windowsMap[requestId] = window;
cpmm.sendAsyncMessage("RIL:GetCardLockRetryCount", {
clientId: clientId,
data: {
@ -672,34 +651,51 @@ RILContentHelper.prototype = {
"notifyIccInfoChanged",
null);
break;
case "RIL:CardLockResult": {
case "RIL:GetCardLockResult": {
let requestId = data.requestId;
let requestWindow = this._windowsMap[requestId];
delete this._windowsMap[requestId];
if (data.success) {
let result = new MobileIccCardLockResult(data);
this.fireRequestSuccess(requestId, result);
} else {
if (data.rilMessageType == "iccSetCardLock" ||
data.rilMessageType == "iccUnlockCardLock") {
let cardLockError = new requestWindow.IccCardLockError(data.errorMsg,
data.retryCount);
this.fireRequestDetailedError(requestId, cardLockError);
} else {
this.fireRequestError(requestId, data.errorMsg);
}
if (data.errorMsg) {
this.fireRequestError(requestId, data.errorMsg);
break;
}
this.fireRequestSuccess(requestId,
Cu.cloneInto({ enabled: data.enabled },
requestWindow));
break;
}
case "RIL:CardLockRetryCount":
if (data.success) {
let result = new MobileIccCardLockRetryCount(data);
this.fireRequestSuccess(data.requestId, result);
} else {
this.fireRequestError(data.requestId, data.errorMsg);
case "RIL:SetUnlockCardLockResult": {
let requestId = data.requestId;
let requestWindow = this._windowsMap[requestId];
delete this._windowsMap[requestId];
if (data.errorMsg) {
let cardLockError = new requestWindow.IccCardLockError(data.errorMsg,
data.retryCount);
this.fireRequestDetailedError(requestId, cardLockError);
break;
}
this.fireRequestSuccess(requestId, null);
break;
}
case "RIL:CardLockRetryCount": {
let requestId = data.requestId;
let requestWindow = this._windowsMap[requestId];
delete this._windowsMap[requestId];
if (data.errorMsg) {
this.fireRequestError(data.requestId, data.errorMsg);
break;
}
this.fireRequestSuccess(data.requestId,
Cu.cloneInto({ retryCount: data.retryCount },
requestWindow));
break;
}
case "RIL:StkCommand":
this._deliverEvent(clientId, "_iccListeners", "notifyStkCommand",
[JSON.stringify(data)]);

Просмотреть файл

@ -1789,15 +1789,15 @@ RadioInterface.prototype = {
return this.rilContext;
case "RIL:GetCardLockState":
this.workerMessenger.sendWithIPCMessage(msg, "iccGetCardLockState",
"RIL:CardLockResult");
"RIL:GetCardLockResult");
break;
case "RIL:UnlockCardLock":
this.workerMessenger.sendWithIPCMessage(msg, "iccUnlockCardLock",
"RIL:CardLockResult");
"RIL:SetUnlockCardLockResult");
break;
case "RIL:SetCardLock":
this.workerMessenger.sendWithIPCMessage(msg, "iccSetCardLock",
"RIL:CardLockResult");
"RIL:SetUnlockCardLockResult");
break;
case "RIL:GetCardLockRetryCount":
this.workerMessenger.sendWithIPCMessage(msg, "iccGetCardLockRetryCount",

Просмотреть файл

@ -164,8 +164,8 @@ interface MozIcc : EventTarget
*
* @return a DOMRequest.
* The request's result will be an object containing
* information about the specified lock's status,
* e.g. {lockType: "pin", enabled: true}.
* information about the specified lock's status.
* e.g. {enabled: true}.
*/
[Throws]
DOMRequest getCardLock(DOMString lockType);
@ -248,19 +248,19 @@ interface MozIcc : EventTarget
* control key (NCK1).
*
* unlockCardLock({lockType: "nck1Puk",
* pin: "..."});
* puk: "..."});
*
* (13) Network type 2 PUK depersonalization. Unlocking the Network type 2
* control key (NCK2).
*
* unlockCardLock({lockType: "nck2Puk",
* pin: "..."});
* puk: "..."});
*
* (14) HRPD network PUK depersonalization. Unlocking the HRPD network control
* key (HNCK).
*
* unlockCardLock({lockType: "hnckPuk",
* pin: "..."});
* puk: "..."});
*
* (15) Corporate PUK depersonalization. Unlocking the corporate control key
* (CCK).
@ -287,25 +287,9 @@ interface MozIcc : EventTarget
* puk: "..."});
*
* @return a DOMRequest.
* The request's result will be an object containing
* information about the unlock operation.
*
* Examples:
*
* (1) Unlocking failed:
*
* {
* lockType: "pin",
* success: false,
* retryCount: 2
* }
*
* (2) Unlocking succeeded:
*
* {
* lockType: "pin",
* success: true
* }
* The request's error will be an object containing the number of
* remaining retries
* @see IccCardLockError.
*/
[Throws]
DOMRequest unlockCardLock(any info);
@ -341,25 +325,9 @@ interface MozIcc : EventTarget
* newPin: "..."});
*
* @return a DOMRequest.
* The request's result will be an object containing
* information about the operation.
*
* Examples:
*
* (1) Enabling/Disabling card lock failed or change card lock failed.
*
* {
* lockType: "pin",
* success: false,
* retryCount: 2
* }
*
* (2) Enabling/Disabling card lock succeed or change card lock succeed.
*
* {
* lockType: "pin",
* success: true
* }
* The request's error will be an object containing the number of
* remaining retries.
* @see IccCardLockError.
*/
[Throws]
DOMRequest setCardLock(any info);
@ -372,9 +340,9 @@ interface MozIcc : EventTarget
* the PUK lock.
*
* @return a DOMRequest.
* If the lock type is "pin", or "puk", the request's result will be
* an object containing the number of retries for the specified
* lock. For any other lock type, the result is undefined.
* The request's result will be an object containing the number of
* remaining retries.
* e.g. {retryCount: 3}.
*/
[Throws]
DOMRequest getCardLockRetryCount(DOMString lockType);

Просмотреть файл

@ -2370,7 +2370,7 @@ FindPendingDir()
static bool
GetPendingDir(nsIFile** dir)
{
MOZ_ASSERT(OOPInitialized());
// MOZ_ASSERT(OOPInitialized());
if (!pendingDirectory) {
return false;
}