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

Unified Diff: build/android/screenshot.py

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/utils/device_temp_file.py ('k') | build/android/surface_stats.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/screenshot.py
diff --git a/build/android/screenshot.py b/build/android/screenshot.py
index fb1aee1d985aaedef0c47c22605328ff4ca969bd..8fe2a95ddd9948e783f7c0831abf4deb421fea91 100755
--- a/build/android/screenshot.py
+++ b/build/android/screenshot.py
@@ -69,9 +69,13 @@ def main():
if options.verbose:
logging.getLogger().setLevel(logging.DEBUG)
- if not options.device and len(android_commands.GetAttachedDevices()) > 1:
+ devices = android_commands.GetAttachedDevices()
+
+ if not options.device and len(devices) > 1:
parser.error('Multiple devices are attached. '
'Please specify device serial number with --device.')
+ elif not options.device and len(devices) == 1:
+ options.device = devices[0]
if len(args) > 1:
parser.error('Too many positional arguments.')
« no previous file with comments | « build/android/pylib/utils/device_temp_file.py ('k') | build/android/surface_stats.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698