Index: adb/contrib/adb_commands_safe.py |
diff --git a/adb/contrib/adb_commands_safe.py b/adb/contrib/adb_commands_safe.py |
index 78d2c50d966f16241b335cb2a9194d5e0b249e52..63da67d2e43596329d167e397150ec01a329a3d1 100644 |
--- a/adb/contrib/adb_commands_safe.py |
+++ b/adb/contrib/adb_commands_safe.py |
@@ -327,7 +327,7 @@ class AdbCommandsSafe(object): |
break |
return False |
- def Reboot(self): |
+ def Reboot(self, wait=True): |
"""Reboots the device. Waits for it to be rebooted but not fully |
operational. |
@@ -340,6 +340,9 @@ class AdbCommandsSafe(object): |
Returns True on success. |
""" |
if self._adb_cmd: |
+ if not wait: |
+ return self._Reboot() |
+ |
# Get previous uptime to ensure the phone actually rebooted. |
previous_uptime = self.GetUptime() |
if not previous_uptime: |
@@ -387,6 +390,15 @@ class AdbCommandsSafe(object): |
break |
return False |
+ def ResetHandle(self, new_endpoint=None): |
M-A Ruel
2016/07/23 00:58:44
Please add a docstring.
bpastene
2016/07/23 01:17:39
Done.
|
+ if self._adb_cmd: |
+ self._adb_cmd.Close() |
+ self._adb_cmd = None |
+ if new_endpoint: |
+ self._serial = None |
+ self._handle.Reset(new_endpoint=new_endpoint) |
+ return self._Connect(False) |
+ |
def Shell(self, cmd, timeout_ms=None): |
"""Runs a command on an Android device while swallowing exceptions. |