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

Unified Diff: build/android/pylib/device/device_utils.py

Issue 1047703002: [Android] Clean up old_interface in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « build/android/pylib/base/base_test_runner.py ('k') | build/android/pylib/gtest/test_options.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9f538e1b0efd9f51ffaa4c1345febe8149edccc6..e9dc9b71738c10568a18168c0764489744dff275 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -72,6 +72,17 @@ _CONTROL_CHARGING_COMMANDS = [
},
]
+# This must be done in a single shell command.
+_RESTART_ADBD_SCRIPT = """
+ function restart() {
+ stop adbd
+ start adbd
+ }
+
+ restart &
+"""
+
+
@decorators.WithExplicitTimeoutAndRetries(
_DEFAULT_TIMEOUT, _DEFAULT_RETRIES)
def GetAVDs():
@@ -382,6 +393,12 @@ class DeviceUtils(object):
if wifi:
timeout_retry.WaitFor(wifi_enabled)
+ @decorators.WithTimeoutAndRetriesFromInstance()
+ def RestartAdbd(self, timeout=None, retries=None):
+ self.RunShellCommand(['sh', '-c', _RESTART_ADBD_SCRIPT],
+ as_root=True, check_return=True)
+ self.adb.WaitForDevice()
+
REBOOT_DEFAULT_TIMEOUT = 10 * _DEFAULT_TIMEOUT
REBOOT_DEFAULT_RETRIES = _DEFAULT_RETRIES
« no previous file with comments | « build/android/pylib/base/base_test_runner.py ('k') | build/android/pylib/gtest/test_options.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698