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

Side by Side Diff: appengine/swarming/swarming_bot/api/platforms/android.py

Issue 2405613002: swarming: Enable USB resets in python-adb on the staging instance. (Closed)
Patch Set: move is_staging check to bot_config Created 4 years, 2 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 | appengine/third_party/python-adb/adb/contrib/adb_commands_safe.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 # Copyright 2015 The LUCI Authors. All rights reserved. 1 # Copyright 2015 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Android specific utility functions. 5 """Android specific utility functions.
6 6
7 This file serves as an API to bot_config.py. bot_config.py can be replaced on 7 This file serves as an API to bot_config.py. bot_config.py can be replaced on
8 the server to allow additional server-specific functionality. 8 the server to allow additional server-specific functionality.
9 """ 9 """
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 p for p in device.GetPackages() or [] 99 p for p in device.GetPackages() or []
100 if (not p.startswith(('com.android.', 'com.google.')) and 100 if (not p.startswith(('com.android.', 'com.google.')) and
101 p not in KNOWN_APPS) 101 p not in KNOWN_APPS)
102 ] 102 ]
103 103
104 104
105 def initialize(pub_key, priv_key): 105 def initialize(pub_key, priv_key):
106 return high.Initialize(pub_key, priv_key) 106 return high.Initialize(pub_key, priv_key)
107 107
108 108
109 def get_devices(bot, endpoints=None): 109 def get_devices(bot, endpoints=None, enable_resets=False):
110 devices = [] 110 devices = []
111 if not gce.is_gce(): 111 if not gce.is_gce():
112 devices += high.GetLocalDevices( 112 devices += high.GetLocalDevices(
113 'swarming', 10000, 10000, on_error=bot.post_error if bot else None, 113 'swarming', 10000, 10000, on_error=bot.post_error if bot else None,
114 as_root=False) 114 as_root=False, enable_resets=enable_resets)
115 115
116 if endpoints: 116 if endpoints:
117 devices += high.GetRemoteDevices( 117 devices += high.GetRemoteDevices(
118 'swarming', endpoints, 10000, 10000, 118 'swarming', endpoints, 10000, 10000,
119 on_error=bot.post_error if bot else None, as_root=False) 119 on_error=bot.post_error if bot else None, as_root=False)
120 120
121 return devices 121 return devices
122 122
123 123
124 def close_devices(devices): 124 def close_devices(devices):
125 return high.CloseDevices(devices) 125 return high.CloseDevices(devices)
126 126
127 127
128 def kill_adb(): 128 def kill_adb():
129 return adb_commands_safe.KillADB() 129 return adb_commands_safe.KillADB()
OLDNEW
« no previous file with comments | « no previous file | appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698