mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 991589 - Use ro.product.model to identify USB devices. r=jryans
This commit is contained in:
parent
8868f0fec4
commit
d079299eaa
@ -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");
|
||||
},
|
||||
|
@ -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;
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user