mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Remove numeric flags in favor of plain string data. Scales better.
This commit is contained in:
parent
f173e6650a
commit
01339b089e
3 changed files with 4 additions and 73 deletions
|
@ -145,30 +145,6 @@ devutil.killProcsByComm = function(adb, serial, comm, bin, mode) {
|
|||
})
|
||||
}
|
||||
|
||||
devutil.platform = function(platform) {
|
||||
switch (platform) {
|
||||
case 'android':
|
||||
return wire.DevicePlatform.ANDROID
|
||||
default:
|
||||
throw new Error(util.format('Unmapped platform "%s"', platform))
|
||||
}
|
||||
}
|
||||
|
||||
devutil.manufacturer = function(manufacturer) {
|
||||
var sanitized = manufacturer.toUpperCase().replace(/ /g, '_')
|
||||
|
||||
if (wire.DeviceManufacturer[sanitized]) {
|
||||
return wire.DeviceManufacturer[sanitized]
|
||||
}
|
||||
|
||||
switch (sanitized) {
|
||||
case 'LGE':
|
||||
return wire.DeviceManufacturer.LG
|
||||
default:
|
||||
throw new Error(util.format('Unmapped manufacturer "%s"', manufacturer))
|
||||
}
|
||||
}
|
||||
|
||||
devutil.makeIdentity = function(serial, properties) {
|
||||
var model = properties['ro.product.model']
|
||||
, brand = properties['ro.product.brand']
|
||||
|
@ -193,8 +169,8 @@ devutil.makeIdentity = function(serial, properties) {
|
|||
|
||||
return {
|
||||
serial: serial
|
||||
, platform: devutil.platform('android')
|
||||
, manufacturer: devutil.manufacturer(manufacturer)
|
||||
, platform: 'Android'
|
||||
, manufacturer: manufacturer.toUpperCase()
|
||||
, operator: operator
|
||||
, model: model
|
||||
, version: version
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue