Index: build/android/pylib/device/device_utils.py |
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py |
index e4c66525d193bf972989dd889a04672d0f8f04f4..269ffe1347648db0b1fa4b5dbc33c4f56099e482 100644 |
--- a/build/android/pylib/device/device_utils.py |
+++ b/build/android/pylib/device/device_utils.py |
@@ -390,6 +390,49 @@ class DeviceUtils(object): |
for k, v in intent.extras.items() if len(k) > 0] |
self.old_interface.BroadcastIntent(package, old_intent, *args) |
+ @decorators.WithTimeoutAndRetriesFromInstance() |
+ def GoHome(self, timeout=None, retries=None): |
+ """ Return to the home screen. |
frankf
2014/06/25 19:19:30
remove space here and below
jbudorick
2014/06/25 21:04:28
Done.
|
+ |
+ Args: |
+ timeout: Same as for |IsOnline|. |
+ retries: Same as for |IsOnline|. |
+ """ |
+ self.old_interface.GoHome() |
+ |
+ @decorators.WithTimeoutAndRetriesFromInstance() |
+ def ForceStop(self, package, timeout=None, retries=None): |
+ """ Close the application. |
+ |
+ Args: |
+ package: A string containing the name of the package to stop. |
+ timeout: Same as for |IsOnline|. |
Victor Starodub
2014/06/25 19:35:45
Maybe expand these? IsOnline is 300 lines away and
|
+ retries: Same as for |IsOnline|. |
+ """ |
+ self.old_interface.CloseApplication(package) |
+ |
+ @decorators.WithTimeoutAndRetriesFromInstance() |
+ def ClearApplicationState(self, package, timeout=None, retries=None): |
+ """ Clear all state for the given package. |
+ |
+ Args: |
+ package: A string containing the name of the package to stop. |
+ timeout: Same as for |IsOnline|. |
+ retries: Same as for |IsOnline|. |
+ """ |
+ self.old_interface.ClearApplicationState(package) |
+ |
+ @decorators.WithTimeoutAndRetriesFromInstance() |
+ def SendKeyEvent(self, keycode, timeout=None, retries=None): |
+ """ Sends a keycode to the device. |
+ |
+ Args: |
+ keycode: A integer keycode to send to the device. |
frankf
2014/06/25 19:19:30
should this be an enum of some sort?
jbudorick
2014/06/25 21:04:28
It could be, although I'm reluctant to include it
|
+ timeout: Same as for |IsOnline|. |
+ retries: Same as for |IsOnline|. |
+ """ |
+ self.old_interface.SendKeyEvent(keycode) |
+ |
def __str__(self): |
"""Returns the device serial.""" |
return self.old_interface.GetDevice() |