Skip to content

Commit

Permalink
Add OpenGL ES version to device properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
koral-- committed Dec 18, 2017
1 parent 2dac3d1 commit 2af554e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/db/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ dbapi.saveDeviceIdentity = function(serial, identity) {
, phone: identity.phone
, product: identity.product
, cpuPlatform: identity.cpuPlatform
, openGLESVersion: identity.openGLESVersion
}))
}

Expand Down
1 change: 1 addition & 0 deletions lib/units/device/plugins/solo.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = syrup.serial()
, new wire.DevicePhoneMessage(identity.phone)
, identity.product
, identity.cpuPlatform
, identity.openGLESVersion
))
])
})
Expand Down
12 changes: 12 additions & 0 deletions lib/util/devutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ devutil.makeIdentity = function(serial, properties) {
var abi = properties['ro.product.cpu.abi']
var product = properties['ro.product.name']
var cpuPlatform = properties['ro.board.platform']
var openGLESVersion = properties['ro.opengles.version']

openGLESVersion = parseInt(openGLESVersion, 10)
if (isNaN(openGLESVersion)) {
openGLESVersion = '0.0'
}
else {
var openGLESVersionMajor = (openGLESVersion & 0xffff0000) >> 16
var openGLESVersionMinor = (openGLESVersion & 0xffff)
openGLESVersion = openGLESVersionMajor + '.' + openGLESVersionMinor
}

// Remove brand prefix for consistency
if (model.substr(0, brand.length) === brand) {
Expand All @@ -132,5 +143,6 @@ devutil.makeIdentity = function(serial, properties) {
, sdk: sdk
, product: product
, cpuPlatform: cpuPlatform
, openGLESVersion: openGLESVersion
}
}
1 change: 1 addition & 0 deletions lib/wire/wire.proto
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ message DeviceIdentityMessage {
required DevicePhoneMessage phone = 11;
optional string product = 12;
optional string cpuPlatform = 13;
optional string openGLESVersion = 14;
}

message DeviceProperty {
Expand Down
6 changes: 6 additions & 0 deletions res/app/device-list/column/device-column-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ module.exports = function DeviceColumnService($filter, gettext) {
return device.cpuPlatform || ''
}
})
, openGLESVersion: TextCell({
title: gettext('OpenGL ES version')
, value: function(device) {
return device.openGLESVersion || ''
}
})
, phone: TextCell({
title: gettext('Phone')
, value: function(device) {
Expand Down
4 changes: 4 additions & 0 deletions res/app/device-list/device-list-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ module.exports = function DeviceListCtrl(
name: 'cpuPlatform'
, selected: false
}
, {
name: 'openGLESVersion'
, selected: false
}
, {
name: 'browser'
, selected: false
Expand Down

0 comments on commit 2af554e

Please sign in to comment.