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:
@@ -280,6 +280,31 @@ module.exports = syrup.serial()
|
||||
return plugin.getClipboard()
|
||||
}
|
||||
|
||||
plugin.getDisplay = function(id) {
|
||||
return runServiceCommand(
|
||||
apk.wire.MessageType.GET_DISPLAY
|
||||
, new apk.wire.GetDisplayRequest(id)
|
||||
)
|
||||
.timeout(10000)
|
||||
.then(function(data) {
|
||||
var response = apk.wire.GetDisplayResponse.decode(data)
|
||||
if (response.success) {
|
||||
return {
|
||||
id: id
|
||||
, width: response.width
|
||||
, height: response.height
|
||||
, xdpi: response.xdpi
|
||||
, ydpi: response.ydpi
|
||||
, fps: response.fps
|
||||
, density: response.density
|
||||
, rotation: response.rotation
|
||||
, secure: response.secure
|
||||
}
|
||||
}
|
||||
throw new Error('Unable to retrieve display information')
|
||||
})
|
||||
}
|
||||
|
||||
plugin.wake = function() {
|
||||
return runAgentCommand(
|
||||
apk.wire.MessageType.DO_WAKE
|
||||
|
||||
Reference in New Issue
Block a user