mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 912898 - B2G: Don't kill adb (or lock the screen) if a debugger client is connected r=past
This commit is contained in:
parent
0f45803eae
commit
a1fd669571
@ -314,8 +314,15 @@ let AdbController = {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 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 = Object.keys(DebuggerServer._connections).length > 0;
|
||||
debug("isDebugging=" + isDebugging);
|
||||
|
||||
let enableAdb = this.remoteDebuggerEnabled &&
|
||||
!(this.lockEnabled && this.locked);
|
||||
(!(this.lockEnabled && this.locked) || isDebugging);
|
||||
|
||||
let useDisableAdbTimer = true;
|
||||
try {
|
||||
if (Services.prefs.getBoolPref("marionette.defaultPrefs.enabled")) {
|
||||
@ -366,7 +373,7 @@ let AdbController = {
|
||||
}
|
||||
}
|
||||
if (useDisableAdbTimer) {
|
||||
if (enableAdb) {
|
||||
if (enableAdb && !isDebugging) {
|
||||
this.startDisableAdbTimer();
|
||||
} else {
|
||||
this.stopDisableAdbTimer();
|
||||
|
@ -1025,6 +1025,10 @@ let RemoteDebugger = {
|
||||
DebuggerServer.addActors('chrome://browser/content/dbg-browser-actors.js');
|
||||
DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/webapps.js");
|
||||
DebuggerServer.registerModule("devtools/server/actors/device");
|
||||
|
||||
DebuggerServer.onConnectionChange = function(what) {
|
||||
AdbController.updateState();
|
||||
}
|
||||
}
|
||||
|
||||
let port = Services.prefs.getIntPref('devtools.debugger.remote-port') || 6000;
|
||||
|
@ -177,6 +177,19 @@ var DebuggerServer = {
|
||||
*/
|
||||
chromeWindowType: null,
|
||||
|
||||
/**
|
||||
* Set that to a function that will be called anytime a new connection
|
||||
* is opened or one is closed.
|
||||
*/
|
||||
onConnectionChange: null,
|
||||
|
||||
_fireConnectionChange: function(aWhat) {
|
||||
if (this.onConnectionChange &&
|
||||
typeof this.onConnectionChange === "function") {
|
||||
this.onConnectionChange(aWhat);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Prompt the user to accept or decline the incoming connection. This is the
|
||||
* default implementation that products embedding the debugger server may
|
||||
@ -275,6 +288,9 @@ var DebuggerServer = {
|
||||
delete this._allowConnection;
|
||||
this._transportInitialized = false;
|
||||
this._initialized = false;
|
||||
|
||||
this._fireConnectionChange("closed");
|
||||
|
||||
dumpn("Debugger server is shut down.");
|
||||
},
|
||||
|
||||
@ -546,6 +562,7 @@ var DebuggerServer = {
|
||||
}
|
||||
aTransport.ready();
|
||||
|
||||
this._fireConnectionChange("opened");
|
||||
return conn;
|
||||
},
|
||||
|
||||
@ -554,6 +571,7 @@ var DebuggerServer = {
|
||||
*/
|
||||
_connectionClosed: function DS_connectionClosed(aConnection) {
|
||||
delete this._connections[aConnection.prefix];
|
||||
this._fireConnectionChange("closed");
|
||||
},
|
||||
|
||||
// DebuggerServer extension API.
|
||||
|
Loading…
Reference in New Issue
Block a user