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

Unified Diff: build/android/adb_install_apk.py

Issue 1281923003: [Android] Add --blacklist-file as a command-line option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix telemetry_unittests 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 | « no previous file | build/android/adb_reverse_forwarder.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/adb_install_apk.py
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py
index 50faea7d29110ce38ff924e1ed1c74e8266b526a..3000b811385abb1c3853755ab1a7f2a549667898 100755
--- a/build/android/adb_install_apk.py
+++ b/build/android/adb_install_apk.py
@@ -53,6 +53,7 @@ def main():
'Default is env var BUILDTYPE or Debug.')
parser.add_argument('-d', '--device', dest='device',
help='Target device for apk to install on.')
+ parser.add_argument('--blacklist-file', help='Device blacklist JSON file.')
parser.add_argument('-v', '--verbose', action='count',
help='Enable verbose logging.')
@@ -82,7 +83,13 @@ def main():
and helper.GetSplitName()):
splits.append(f)
- devices = device_utils.DeviceUtils.HealthyDevices()
+ if args.blacklist_file:
+ blacklist = device_blacklist.Blacklist(args.blacklist_file)
+ else:
+ # TODO(jbudorick): Remove this once the bots are converted.
+ blacklist = device_blacklist.Blacklist(device_blacklist.BLACKLIST_JSON)
+
+ devices = device_utils.DeviceUtils.HealthyDevices(blacklist)
if args.device:
devices = [d for d in devices if d == args.device]
@@ -99,12 +106,14 @@ def main():
device.Install(apk, reinstall=args.keep_data)
except device_errors.CommandFailedError:
logging.exception('Failed to install %s', args.apk_name)
- device_blacklist.ExtendBlacklist([str(device)])
- logging.warning('Blacklisting %s', str(device))
+ if blacklist:
+ blacklist.Extend([str(device)])
+ logging.warning('Blacklisting %s', str(device))
except device_errors.CommandTimeoutError:
logging.exception('Timed out while installing %s', args.apk_name)
- device_blacklist.ExtendBlacklist([str(device)])
- logging.warning('Blacklisting %s', str(device))
+ if blacklist:
+ blacklist.Extend([str(device)])
+ logging.warning('Blacklisting %s', str(device))
device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install)
« no previous file with comments | « no previous file | build/android/adb_reverse_forwarder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698