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

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

Issue 1292053006: Revert of [Android] Add --blacklist-file as a command-line option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/device/device_blacklist.py ('k') | 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/device/device_utils.py
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
index 522bf331d67c5f9f04c1a1b6987c384887a350cb..bc1f2ab27339c25b18d03ccac517649c15017c55 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -1843,7 +1843,7 @@
}
@classmethod
- def parallel(cls, devices, async=False):
+ def parallel(cls, devices=None, async=False):
"""Creates a Parallelizer to operate over the provided list of devices.
If |devices| is either |None| or an empty list, the Parallelizer will
@@ -1860,7 +1860,9 @@
A Parallelizer operating over |devices|.
"""
if not devices:
- raise device_errors.NoDevicesError()
+ devices = cls.HealthyDevices()
+ if not devices:
+ raise device_errors.NoDevicesError()
devices = [d if isinstance(d, cls) else cls(d) for d in devices]
if async:
@@ -1869,14 +1871,10 @@
return parallelizer.SyncParallelizer(devices)
@classmethod
- def HealthyDevices(cls, blacklist=None):
- if not blacklist:
- # TODO(jbudorick): Remove once clients pass in the blacklist.
- blacklist = device_blacklist.Blacklist(device_blacklist.BLACKLIST_JSON)
-
- blacklisted_devices = blacklist.Read()
+ def HealthyDevices(cls):
+ blacklist = device_blacklist.ReadBlacklist()
def blacklisted(adb):
- if adb.GetDeviceSerial() in blacklisted_devices:
+ if adb.GetDeviceSerial() in blacklist:
logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial())
return True
return False
« no previous file with comments | « build/android/pylib/device/device_blacklist.py ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698