Index: build/android/pylib/android_commands.py |
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py |
index 9f5c2dfbe86dc3fc88eb2d0ccdb35a8f7dfa8cbd..8ddb30570c30fa039a0239321cfe35a17674ee2b 100644 |
--- a/build/android/pylib/android_commands.py |
+++ b/build/android/pylib/android_commands.py |
@@ -459,6 +459,17 @@ class AndroidCommands(object): |
if out.strip() != 'remount succeeded': |
raise errors.MsgException('Remount failed: %s' % out) |
+ def KillAdbdDevice(self): |
+ try: |
+ logging.info('Killing adbd on the device...') |
+ adb_pids = self.ExtractPid('adbd') |
+ if adb_pids: |
+ self.RunShellCommandWithSU('kill %s' % ' '.join(adb_pids)) |
+ logging.info('Waiting for device to settle...') |
+ time.sleep(5) |
+ except Exception as e: |
craigdh
2013/10/02 17:36:53
Let's not eat the exception here. It's fine if you
bulach
2013/10/03 08:26:13
good point! agreed, moved the try..except up to th
|
+ logging.error('Exception when killing adbd %s', e) |
+ |
def RestartAdbServer(self): |
"""Restart the adb server.""" |
ret = self.KillAdbServer() |