mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +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
|
@ -2,6 +2,7 @@ var util = require('util')
|
|||
|
||||
var split = require('split')
|
||||
var Promise = require('bluebird')
|
||||
var androidDeviceList = require('android-device-list')
|
||||
|
||||
var devutil = module.exports = Object.create(null)
|
||||
|
||||
|
@ -135,6 +136,7 @@ devutil.makeIdentity = function(serial, properties) {
|
|||
var product = properties['ro.product.name']
|
||||
var cpuPlatform = properties['ro.board.platform']
|
||||
var openGLESVersion = properties['ro.opengles.version']
|
||||
var marketName = properties['ro.product.device']
|
||||
|
||||
openGLESVersion = parseInt(openGLESVersion, 10)
|
||||
if (isNaN(openGLESVersion)) {
|
||||
|
@ -157,6 +159,13 @@ devutil.makeIdentity = function(serial, properties) {
|
|||
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
|
||||
// model = model.replace(/[_ ]/g, '')
|
||||
return {
|
||||
|
@ -171,5 +180,6 @@ devutil.makeIdentity = function(serial, properties) {
|
|||
, product: product
|
||||
, cpuPlatform: cpuPlatform
|
||||
, openGLESVersion: openGLESVersion
|
||||
, marketName: marketName
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue