mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Add market name to device properties.
This commit is contained in:
parent
6fd750dad5
commit
3d3d1f67b4
7 changed files with 24 additions and 0 deletions
|
@ -324,6 +324,7 @@ dbapi.saveDeviceIdentity = function(serial, identity) {
|
||||||
, product: identity.product
|
, product: identity.product
|
||||||
, cpuPlatform: identity.cpuPlatform
|
, cpuPlatform: identity.cpuPlatform
|
||||||
, openGLESVersion: identity.openGLESVersion
|
, openGLESVersion: identity.openGLESVersion
|
||||||
|
, marketName: identity.marketName
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ module.exports = syrup.serial()
|
||||||
, identity.product
|
, identity.product
|
||||||
, identity.cpuPlatform
|
, identity.cpuPlatform
|
||||||
, identity.openGLESVersion
|
, identity.openGLESVersion
|
||||||
|
, identity.marketName
|
||||||
))
|
))
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,6 +2,7 @@ var util = require('util')
|
||||||
|
|
||||||
var split = require('split')
|
var split = require('split')
|
||||||
var Promise = require('bluebird')
|
var Promise = require('bluebird')
|
||||||
|
var androidDeviceList = require('android-device-list')
|
||||||
|
|
||||||
var devutil = module.exports = Object.create(null)
|
var devutil = module.exports = Object.create(null)
|
||||||
|
|
||||||
|
@ -135,6 +136,7 @@ devutil.makeIdentity = function(serial, properties) {
|
||||||
var product = properties['ro.product.name']
|
var product = properties['ro.product.name']
|
||||||
var cpuPlatform = properties['ro.board.platform']
|
var cpuPlatform = properties['ro.board.platform']
|
||||||
var openGLESVersion = properties['ro.opengles.version']
|
var openGLESVersion = properties['ro.opengles.version']
|
||||||
|
var marketName = properties['ro.product.device']
|
||||||
|
|
||||||
openGLESVersion = parseInt(openGLESVersion, 10)
|
openGLESVersion = parseInt(openGLESVersion, 10)
|
||||||
if (isNaN(openGLESVersion)) {
|
if (isNaN(openGLESVersion)) {
|
||||||
|
@ -157,6 +159,13 @@ devutil.makeIdentity = function(serial, properties) {
|
||||||
model = model.substr(manufacturer.length)
|
model = model.substr(manufacturer.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (marketName) {
|
||||||
|
var devices = androidDeviceList.getDevicesByDeviceId(marketName)
|
||||||
|
if (devices.length > 0) {
|
||||||
|
marketName = devices[0].name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clean up remaining model name
|
// Clean up remaining model name
|
||||||
// model = model.replace(/[_ ]/g, '')
|
// model = model.replace(/[_ ]/g, '')
|
||||||
return {
|
return {
|
||||||
|
@ -171,5 +180,6 @@ devutil.makeIdentity = function(serial, properties) {
|
||||||
, product: product
|
, product: product
|
||||||
, cpuPlatform: cpuPlatform
|
, cpuPlatform: cpuPlatform
|
||||||
, openGLESVersion: openGLESVersion
|
, openGLESVersion: openGLESVersion
|
||||||
|
, marketName: marketName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,6 +230,7 @@ message DeviceIdentityMessage {
|
||||||
optional string product = 12;
|
optional string product = 12;
|
||||||
optional string cpuPlatform = 13;
|
optional string cpuPlatform = 13;
|
||||||
optional string openGLESVersion = 14;
|
optional string openGLESVersion = 14;
|
||||||
|
optional string marketName = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeviceProperty {
|
message DeviceProperty {
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
"adbkit": "^2.11.1",
|
"adbkit": "^2.11.1",
|
||||||
"adbkit-apkreader": "^3.1.1",
|
"adbkit-apkreader": "^3.1.1",
|
||||||
"adbkit-monkey": "^1.0.1",
|
"adbkit-monkey": "^1.0.1",
|
||||||
|
"android-device-list": "^1.1.85",
|
||||||
"aws-sdk": "^2.4.13",
|
"aws-sdk": "^2.4.13",
|
||||||
"basic-auth": "^1.0.3",
|
"basic-auth": "^1.0.3",
|
||||||
"bluebird": "^2.10.1",
|
"bluebird": "^2.10.1",
|
||||||
|
|
|
@ -179,6 +179,12 @@ module.exports = function DeviceColumnService($filter, gettext) {
|
||||||
return device.manufacturer || ''
|
return device.manufacturer || ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
, marketName: TextCell({
|
||||||
|
title: gettext('Market name')
|
||||||
|
, value: function(device) {
|
||||||
|
return device.marketName || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
, sdk: NumberCell({
|
, sdk: NumberCell({
|
||||||
title: gettext('SDK')
|
title: gettext('SDK')
|
||||||
, defaultOrder: 'desc'
|
, defaultOrder: 'desc'
|
||||||
|
|
|
@ -55,6 +55,10 @@ module.exports = function DeviceListCtrl(
|
||||||
name: 'manufacturer'
|
name: 'manufacturer'
|
||||||
, selected: false
|
, selected: false
|
||||||
}
|
}
|
||||||
|
, {
|
||||||
|
name: 'marketName'
|
||||||
|
, selected: false
|
||||||
|
}
|
||||||
, {
|
, {
|
||||||
name: 'sdk'
|
name: 'sdk'
|
||||||
, selected: false
|
, selected: false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue