mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:33:30 +02:00
Never lock rotation so that it remains usable on device side too.
This commit is contained in:
@@ -286,6 +286,13 @@ module.exports = syrup.serial()
|
||||
)
|
||||
}
|
||||
|
||||
plugin.rotate = function(rotation) {
|
||||
return runAgentCommand(
|
||||
apk.wire.MessageType.SET_ROTATION
|
||||
, new apk.wire.SetRotationRequest(rotation, false)
|
||||
)
|
||||
}
|
||||
|
||||
plugin.freezeRotation = function(rotation) {
|
||||
return runAgentCommand(
|
||||
apk.wire.MessageType.SET_ROTATION
|
||||
@@ -510,12 +517,7 @@ module.exports = syrup.serial()
|
||||
plugin.type(message.text)
|
||||
})
|
||||
.on(wire.RotateMessage, function(channel, message) {
|
||||
if (message.rotation >= 0) {
|
||||
plugin.freezeRotation(message.rotation)
|
||||
}
|
||||
else {
|
||||
plugin.thawRotation()
|
||||
}
|
||||
plugin.rotate(message.rotation)
|
||||
})
|
||||
})
|
||||
.return(plugin)
|
||||
|
||||
Reference in New Issue
Block a user