Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2440)

Unified Diff: build/android/pylib/android_commands.py

Issue 304053002: A kinder, gentler adbd restart (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/pylib/restart_adbd.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index ee12cd436a2dbc90f903c66dac37f933ba99e294..d0ef0a3db0a75462247e6c3b6dd77573bf2cdc48 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -544,19 +544,16 @@ class AndroidCommands(object):
raise errors.MsgException('Remount failed: %s' % out)
def RestartAdbdOnDevice(self):
- logging.info('Killing adbd on the device...')
- adb_pids = self.ExtractPid('adbd')
- if not adb_pids:
- raise errors.MsgException('Unable to obtain adbd pid')
- try:
- self.KillAll('adbd', signum=signal.SIGTERM, with_su=True)
- logging.info('Waiting for device to settle...')
+ logging.info('Restarting adbd on the device...')
+ with DeviceTempFile(self, suffix=".sh") as temp_script_file:
bulach 2014/06/02 11:47:50 nit: s/"/'/
+ host_script_path = os.path.join(constants.DIR_SOURCE_ROOT,
+ 'build',
+ 'android',
+ 'pylib',
+ 'restart_adbd.sh')
+ self._adb.Push(host_script_path, temp_script_file.name)
+ self.RunShellCommand('. %s' % temp_script_file.name)
self._adb.SendCommand('wait-for-device')
- new_adb_pids = self.ExtractPid('adbd')
- if new_adb_pids == adb_pids:
- logging.warning('adbd on the device may not have been restarted.')
- except Exception as e:
- logging.error('Exception when trying to kill adbd on the device [%s]', e)
def RestartAdbServer(self):
"""Restart the adb server."""
« no previous file with comments | « no previous file | build/android/pylib/restart_adbd.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698