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

Side by Side Diff: build/android/adb_install_apk.py

Issue 1334803002: Revert of [Android] Don't use a device blacklist if one isn't provided. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | build/android/adb_reverse_forwarder.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Utility script to install APKs from the command line quickly.""" 7 """Utility script to install APKs from the command line quickly."""
8 8
9 import argparse 9 import argparse
10 import glob 10 import glob
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 for split_glob in args.splits: 76 for split_glob in args.splits:
77 apks = [f for f in glob.glob(split_glob) if f.endswith('.apk')] 77 apks = [f for f in glob.glob(split_glob) if f.endswith('.apk')]
78 if not apks: 78 if not apks:
79 logging.warning('No apks matched for %s.', split_glob) 79 logging.warning('No apks matched for %s.', split_glob)
80 for f in apks: 80 for f in apks:
81 helper = apk_helper.ApkHelper(f) 81 helper = apk_helper.ApkHelper(f)
82 if (helper.GetPackageName() == base_apk_package 82 if (helper.GetPackageName() == base_apk_package
83 and helper.GetSplitName()): 83 and helper.GetSplitName()):
84 splits.append(f) 84 splits.append(f)
85 85
86 blacklist = (device_blacklist.Blacklist(args.blacklist_file) 86 if args.blacklist_file:
87 if args.blacklist_file 87 blacklist = device_blacklist.Blacklist(args.blacklist_file)
88 else None) 88 else:
89 # TODO(jbudorick): Remove this once the bots are converted.
90 blacklist = device_blacklist.Blacklist(device_blacklist.BLACKLIST_JSON)
91
89 devices = device_utils.DeviceUtils.HealthyDevices(blacklist) 92 devices = device_utils.DeviceUtils.HealthyDevices(blacklist)
90 93
91 if args.device: 94 if args.device:
92 devices = [d for d in devices if d == args.device] 95 devices = [d for d in devices if d == args.device]
93 if not devices: 96 if not devices:
94 raise device_errors.DeviceUnreachableError(args.device) 97 raise device_errors.DeviceUnreachableError(args.device)
95 elif not devices: 98 elif not devices:
96 raise device_errors.NoDevicesError() 99 raise device_errors.NoDevicesError()
97 100
98 def blacklisting_install(device): 101 def blacklisting_install(device):
(...skipping 12 matching lines...) Expand all
111 if blacklist: 114 if blacklist:
112 blacklist.Extend([str(device)]) 115 blacklist.Extend([str(device)])
113 logging.warning('Blacklisting %s', str(device)) 116 logging.warning('Blacklisting %s', str(device))
114 117
115 device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install) 118 device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install)
116 119
117 120
118 if __name__ == '__main__': 121 if __name__ == '__main__':
119 sys.exit(main()) 122 sys.exit(main())
120 123
OLDNEW
« 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