1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +00:00

AndroidTarget: Changes default unlocking method

Instead of using a default 'horizontal' unlocking method, now will try
a diagonal swipe up as this should work most modern devices with vertical or
horizontal unlocking methods.
This commit is contained in:
Marc Bonnici 2017-08-10 17:19:13 +01:00
parent 1229af0895
commit 8839ed01ba

View File

@ -1061,10 +1061,15 @@ class AndroidTarget(Target):
# Android-specific # Android-specific
def swipe_to_unlock(self, direction="horizontal"): def swipe_to_unlock(self, direction="diagonal"):
width, height = self.screen_resolution width, height = self.screen_resolution
command = 'input swipe {} {} {} {}' command = 'input swipe {} {} {} {}'
if direction == "horizontal": if direction == "diagonal":
start = 100
stop = width - start
swipe_height = height * 2 // 3
self.execute(command.format(start, swipe_height, stop, 0))
elif direction == "horizontal":
swipe_height = height * 2 // 3 swipe_height = height * 2 // 3
start = 100 start = 100
stop = width - start stop = width - start