1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +02:00

Never lock rotation so that it remains usable on device side too.

This commit is contained in:
Simo Kinnunen 2014-05-02 15:43:23 +09:00
parent 7a598af243
commit eadc0954a1

View file

@ -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)