Bug 1492700 - Remove unused observables in commands/track-devices;r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Wed, 05 Dec 2018 20:51:41 +0000
changeset 508738 271eb6988c586ce2f460768be1680ce904fc1e26
parent 508737 41384e20308d690d1bd65288a1b1af9da24851d9
child 508739 c804e90f0ce5daec220046b51a387a4edcd59294
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1492700
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1492700 - Remove unused observables in commands/track-devices;r=daisuke Depends on D13474 Differential Revision: https://phabricator.services.mozilla.com/D13475
devtools/shared/adb/commands/track-devices.js
--- a/devtools/shared/adb/commands/track-devices.js
+++ b/devtools/shared/adb/commands/track-devices.js
@@ -4,17 +4,16 @@
 
 // Wrapper around the ADB utility.
 
 "use strict";
 
 const EventEmitter = require("devtools/shared/event-emitter");
 const { dumpn } = require("devtools/shared/DevToolsUtils");
 const { setTimeout } = require("resource://gre/modules/Timer.jsm");
-const { Services } = require("resource://gre/modules/Services.jsm");
 
 const { ADB } = require("../adb");
 const client = require("../adb-client");
 
 const OKAY = 0x59414b4f;
 
 // Start tracking devices connecting and disconnecting from the host.
 // We can't reuse runCommand here because we keep the socket alive.
@@ -38,37 +37,33 @@ class TrackDevicesCommand extends EventE
       this._socket.s.onerror = null;
       this._socket.s.onclose = null;
       this._socket.s.ondata = null;
     }
   }
 
   _onOpen() {
     dumpn("trackDevices onopen");
-    Services.obs.notifyObservers(null, "adb-track-devices-start");
     const req = client.createRequest("host:track-devices");
     this._socket.send(req);
   }
 
   _onError(event) {
     dumpn("trackDevices onerror: " + event);
-    Services.obs.notifyObservers(null, "adb-track-devices-stop");
   }
 
   _onClose() {
     dumpn("trackDevices onclose");
 
     // Report all devices as disconnected
     for (const dev in this._devices) {
       this._devices[dev] = false;
       this.emit("device-disconnected", dev);
     }
 
-    Services.obs.notifyObservers(null, "adb-track-devices-stop");
-
     // When we lose connection to the server,
     // and the adb is still on, we most likely got our server killed
     // by local adb. So we do try to reconnect to it.
 
     // Give some time to the new adb to start
     setTimeout(() => {
       // Only try to reconnect/restart if the add-on is still enabled
       if (ADB.ready) {