Bug 1493104 - Add adbScanner to WebIDE scanners if status is already installed;r=ladybenko,daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 05 Oct 2018 11:21:04 +0200
changeset 488814 5ed3ff9c48f5fb019808b03a4fad45f9dfd74435
parent 488813 a56d01a749647c9bb733ee790bc2111e61a7591d
child 488815 ba67a0aadb68e1df04cf999a9a99e48d40b7d9f8
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersladybenko, daisuke
bugs1493104
milestone64.0a1
Bug 1493104 - Add adbScanner to WebIDE scanners if status is already installed;r=ladybenko,daisuke This fixes the following scenario: - install ADB - connect a Device - start about:debugging => device shows up in sidebar - start WebIDE => device should show up in WebIDE
devtools/client/webide/content/addons.js
--- a/devtools/client/webide/content/addons.js
+++ b/devtools/client/webide/content/addons.js
@@ -51,16 +51,21 @@ function BuildUI() {
   function onAddonProgress(arg) {
     if (arg == -1) {
       progress.removeAttribute("value");
     } else {
       progress.value = arg;
     }
   }
 
+  // If the addon is already installed on startup, add the adbScanner to our
+  // RuntimesScanner.
+  if (adbAddon.status === ADB_ADDON_STATES.INSTALLED) {
+    RuntimeScanners.add(adbScanner);
+  }
   adbAddon.on("update", onAddonUpdate);
   adbAddon.on("failure", onAddonFailure);
   adbAddon.on("progress", onAddonProgress);
 
   window.addEventListener("unload", function() {
     adbAddon.off("update", onAddonUpdate);
     adbAddon.off("failure", onAddonFailure);
     adbAddon.off("progress", onAddonProgress);