/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Duration in milliseconds of the runtime polling. We resort to polling here because we // have no event to know when a runtime started on an already discovered ADB device. const UPDATE_RUNTIMES_INTERVAL = 3000;
class Adb extends EventEmitter {
constructor() { super();
this._trackDevicesCommand = new TrackDevicesCommand();
// Device runtimes are detected by running a shell command and checking for // "firefox-debugger-socket" in the list of currently running processes. this._timer = setInterval( this.updateRuntimes.bind(this),
UPDATE_RUNTIMES_INTERVAL
);
}
/** * This method will emit "runtime-list-ready" to notify the consumer that the list of * runtimes is ready to be retrieved.
*/
async _updateAdbProcess() { if (!this._isTrackingDevices && this._shouldTrack()) { const onRuntimesUpdated = this.once("runtime-list-updated"); this._startTracking(); // If we are starting to track runtimes, the list of runtimes will only be ready // once the first "runtime-list-updated" event has been processed.
await onRuntimesUpdated;
} elseif (this._isTrackingDevices && !this._shouldTrack()) { this._stopTracking();
} this.emit("runtime-list-ready");
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.3Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.