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

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

Issue 392983003: Add a workaround for broken adb get-state call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/device/device_utils_test.py » ('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 7470081459e88a26f20fed135dd650e46ba11bfc..923ebe7c3e9ca14909b148913e09a655c305039c 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -355,8 +355,15 @@ class AndroidCommands(object):
Returns:
True if device is in 'device' mode, False otherwise.
"""
- out = self._adb.SendCommand('get-state')
- return out.strip() == 'device'
+ # TODO(aurimas): revert to using adb get-state when android L adb is fixed.
+ #out = self._adb.SendCommand('get-state')
+ #return out.strip() == 'device'
+
+ out = self._adb.SendCommand('devices')
+ for line in out.split('\n'):
+ if self._device in line and 'device' in line:
+ return True
+ return False
def IsRootEnabled(self):
"""Checks if root is enabled on the device."""
« no previous file with comments | « no previous file | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698