Closed Bug 1492700 Opened 6 years ago Closed 6 years ago

[remote-dbg-next] Fix the timing of enable/disable ADB

Categories

(DevTools :: about:debugging, enhancement, P1)

enhancement

Tracking

(firefox65 fixed)

RESOLVED FIXED
Firefox 65
Tracking Status
firefox65 --- fixed

People

(Reporter: daisuke, Assigned: jdescottes)

References

(Blocks 3 open bugs)

Details

(Whiteboard: old-remote-debugging-ng-m3)

Attachments

(17 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
1.14 KB, patch
jdescottes
: review+
Details | Diff | Splinter Review
Currently, we enable/disable ADB when about:debugging page was opened/closed (bug 1405235).
However, if user is opening another about:debugging page or another application is using, we should not disable ADB.
The other hand, if another application made ADB disable, we should enable again.
So, we need to consider the timing of enable/disable ADB.
Priority: P3 → P2
The status for this one changed a bit. Now when about:debugging starts, we attempt to start ADB if needed (when we start the scanner, if the ADB extension is installed). And when we stop about:debugging we just destroy the scanner but we don't try to shutdown ADB.

I think that for m1 the current behavior is ok, and we should not shutdown ADB automatically when closing about:debugging. ADB is a process, we should not assume about:debugging is the only consumer. However, maybe it could be interesting to let the user know that the ADB process is currently running and give them a way to stop it?
filter on remote-debugging-next-move-m3-to-m2
filter on remote-debugging-next-move-m3-to-m2
filter on remote-debugging-next-move-m3-to-m2
No longer blocks: remote-debugging-ng-m3
Whiteboard: old-remote-debugging-ng-m3
Technically we should implement a mechanism to stop ADB if the process was started by firefox and if no client uses it anymore. 

I think we should also discuss if the status of ADB should be visible somewhere in the UI. It might be interesting for troubleshooting purposes. I think we should handle this in a separate bug.
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Priority: P2 → P1
Blocks: 1509313
I am trying to cleanup a bit our ADB modules in the scope of this bug. The reason behind is that if we want to stop the ADB process when all the "devtools" consumers of ADB no longer want to get ADB updates, then it means we need a clear entry point for all the interaction with ADB. 

In practice, we need to have some global module that will keep track of the consumers, and that will stop the ADB process if the number of consumers is down to 0 _and_ if ADB was started by devtools.

At the moment, all the consumers of ADB are using the "addon-aware-adb-scanner". This means that we could quickly hack something on top of this module to achieve the feature of this bug. However some other modules are also relying on ADB: about:devtools-toolbox when connected to a remote USB runtime for instance. Those modules don't need to scan for ADB runtimes, they just to say that they "need" ADB.

So I would like to cleanup the adb folder so that we can have small public API:
- adb-addon.js 
- adb.js
Keywords: leave-open
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f5f900b18101
Fix ADB stop() in case ADB start() was called several times;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/5199632a4ada
Stop sending adb-addon updates from Devices.jsm;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/7590eb03b4ff
Move Devices.jsm to devtools/shared/adb folder;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/363e8b2ecfab
Convert Devices.jsm to adb-devices-registry module;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/65825c93b47b
adb-device.js should export AdbDevice and not Device;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/d5e67b8fbde3
Stop exposing shell() on adb-device because it only forwards to ADB;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/5db9614af6a5
Fold FirefoxOnAndroidRuntime.detect in scanner.detectRuntimes;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/bbc5bcb72208
Merge Runtime and FirefoxForAndroidRuntime into AdbRuntime;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/21f0a93a65c2
Extract AdbRuntime out of adb-scanner.js;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/ad28397dfa43
Migrate AdbRuntime to a class;r=daisuke
Keywords: leave-open
Blocks: 1511779
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9d8c5a3fc14e
Split adb.js in several files;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/41384e20308d
Migrate adb/commands/track-devices to a Class;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/271eb6988c58
Remove unused observables in commands/track-devices;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/c804e90f0ce5
Rename adb.js to adb-process.js and switch to class;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/738cae90db60
Introduce adb singleton to register adb consumers;r=daisuke
https://hg.mozilla.org/integration/autoland/rev/ec57d6145de7
Add mochitest to check that ADB is stopped after closing about:debugging;r=daisuke
Fix eslint failure.
Attachment #9029817 - Flags: review+
Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2aa7b7e89e14
Fix eslint failure in test_adb.js;r=fix
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: