mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:33:30 +02:00
Fix Galaxy S5's display information segfaulting by trying to use the public SDK methods first. SurfaceComposerClient's getDisplayInfo is practically unusable on Galaxy S5 due to weird memory corruption issues.
This commit is contained in:
@@ -3,13 +3,22 @@ var syrup = require('syrup')
|
||||
var logger = require('../../../util/logger')
|
||||
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('./service'))
|
||||
.dependency(require('./http'))
|
||||
.define(function(options, http) {
|
||||
.define(function(options, service, http) {
|
||||
var log = logger.createLogger('device:plugins:display')
|
||||
|
||||
function fetch() {
|
||||
log.info('Fetching display info')
|
||||
return http.getDisplay(0)
|
||||
return service.getDisplay(0)
|
||||
.catch(function() {
|
||||
log.info('Falling back to HTTP API')
|
||||
return http.getDisplay(0)
|
||||
})
|
||||
.then(function(display) {
|
||||
display.url = http.getDisplayUrl(display.id)
|
||||
return display
|
||||
})
|
||||
}
|
||||
|
||||
return fetch()
|
||||
|
||||
Reference in New Issue
Block a user