gecko-dev/devtools/shared/adb/adb-device.js
Hiroyuki Ikezoe 0a417befc7 Bug 1481691 - Drop root relevant stuff and push and pull. r=jedescottes
As far as I can tell they were all for FirefoxOS.
2018-08-10 16:32:21 +09:00

35 lines
871 B
JavaScript

/* 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/. */
"use strict";
const { ADB } = require("devtools/shared/adb/adb");
/**
* A Device instance is created and registered with the Devices module whenever
* ADB notices a new device is connected.
*/
function Device(id) {
this.id = id;
}
Device.prototype = {
type: "adb",
shell: ADB.shell.bind(ADB),
forwardPort: ADB.forwardPort.bind(ADB),
getModel() {
if (this._modelPromise) {
return this._modelPromise;
}
this._modelPromise = this.shell("getprop ro.product.model")
.then(model => model.trim());
return this._modelPromise;
}
// push, pull were removed in Bug 1481691.
};
module.exports = Device;