Chromium Code Reviews| 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 2d9671d01034f64873c5c0ebd2b889f0e896703c..8090b9a0b9ad5ff7a9cd13e1d52c327d6c58efab 100644 |
| --- a/build/android/pylib/device/device_utils.py |
| +++ b/build/android/pylib/device/device_utils.py |
| @@ -76,6 +76,16 @@ _CONTROL_CHARGING_COMMANDS = [ |
| }, |
| ] |
| +_RESTART_ADBD_SCRIPT = """ |
| + trap '' HUP |
| + trap '' TERM |
| + trap '' PIPE |
| + function restart() { |
| + stop adbd |
| + start adbd |
| + } |
| + restart & |
| +""" |
| _CURRENT_FOCUS_CRASH_RE = re.compile( |
| r'\s*mCurrentFocus.*Application (Error|Not Responding): (\S+)}') |
| @@ -1804,3 +1814,10 @@ class DeviceUtils(object): |
| return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices() |
| if not blacklisted(adb)] |
| + |
| + @decorators.WithTimeoutAndRetriesFromInstance() |
| + def RestartAdbd(self, timeout=None, retries=None): |
|
jbudorick
2015/08/07 22:02:42
This should have a device_test.
rnephew (Reviews Here)
2015/08/07 22:42:11
Done.
|
| + with device_temp_file.DeviceTempFile(self.adb, suffix='.sh') as script: |
| + self.WriteFile(script.name, _RESTART_ADBD_SCRIPT) |
| + self.RunShellCommand(['source', script.name], as_root=True) |
| + self.adb.WaitForDevice() |