Index: build/android/pylib/android_commands.py |
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py |
index 48116b88ffd8e7e7a889ea679ff99e55569e702c..35e0ebda7e9aeed6fe15cf7f52a5d0226ecbd60c 100644 |
--- a/build/android/pylib/android_commands.py |
+++ b/build/android/pylib/android_commands.py |
@@ -114,7 +114,18 @@ def GetAttachedDevices(): |
return devices |
+def GetAttachedOfflineDevices(): |
+ """Returns a list of attached, offline android devices. |
+ |
+ Returns: List of devices with status 'offline'. |
+ """ |
+ re_device = re.compile('^([a-zA-Z0-9_:.-]+)\toffline$', re.MULTILINE) |
+ return re_device.findall(cmd_helper.GetCmdOutput([constants.ADB_PATH, |
+ 'devices'])) |
+ |
+ |
def IsDeviceAttached(device): |
+ """Return true if the device is attached and online.""" |
return device in GetAttachedDevices() |