diff --git a/browser/devtools/webide/modules/app-manager.js b/browser/devtools/webide/modules/app-manager.js index a62b8668a69..c6b0138e44d 100644 --- a/browser/devtools/webide/modules/app-manager.js +++ b/browser/devtools/webide/modules/app-manager.js @@ -533,7 +533,10 @@ exports.AppManager = AppManager = { _updateUSBRuntimes: function() { this.runtimeList.usb = []; for (let id of Devices.available()) { - this.runtimeList.usb.push(new USBRuntime(id)); + let r = new USBRuntime(id); + this.runtimeList.usb.push(r); + r.updateNameFromADB().then( + () => this.update("runtimelist"), () => {}); } this.update("runtimelist"); }, diff --git a/browser/devtools/webide/modules/runtimes.js b/browser/devtools/webide/modules/runtimes.js index 0330f9e0caa..2aefccc2861 100644 --- a/browser/devtools/webide/modules/runtimes.js +++ b/browser/devtools/webide/modules/runtimes.js @@ -33,7 +33,24 @@ USBRuntime.prototype = { return this.id; }, getName: function() { - return this.id; + return this._productModel || this.id; + }, + updateNameFromADB: function() { + if (this._productModel) { + return promise.resolve(); + } + let device = Devices.getByName(this.id); + let deferred = promise.defer(); + if (device && device.shell) { + device.shell("getprop ro.product.model").then(stdout => { + this._productModel = stdout; + deferred.resolve(); + }, () => {}); + } else { + this._productModel = null; + deferred.reject(); + } + return deferred.promise; }, }