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

Side by Side Diff: build/android/pylib/device/device_utils.py

Issue 1167903006: [Android] Speculative fix for DeviceUtils.EnableRoot issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/pylib/device/device_utils_test.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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides a variety of device interactions based on adb. 5 """Provides a variety of device interactions based on adb.
6 6
7 Eventually, this will be based on adb_wrapper. 7 Eventually, this will be based on adb_wrapper.
8 """ 8 """
9 # pylint: disable=unused-argument 9 # pylint: disable=unused-argument
10 10
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 Raises: 283 Raises:
284 CommandFailedError if root could not be enabled. 284 CommandFailedError if root could not be enabled.
285 CommandTimeoutError on timeout. 285 CommandTimeoutError on timeout.
286 """ 286 """
287 if self.IsUserBuild(): 287 if self.IsUserBuild():
288 raise device_errors.CommandFailedError( 288 raise device_errors.CommandFailedError(
289 'Cannot enable root in user builds.', str(self)) 289 'Cannot enable root in user builds.', str(self))
290 if 'needs_su' in self._cache: 290 if 'needs_su' in self._cache:
291 del self._cache['needs_su'] 291 del self._cache['needs_su']
292 self.adb.Root() 292 self.adb.Root()
293 self.adb.WaitForDevice() 293 self.WaitUntilFullyBooted()
294 294
295 @decorators.WithTimeoutAndRetriesFromInstance() 295 @decorators.WithTimeoutAndRetriesFromInstance()
296 def IsUserBuild(self, timeout=None, retries=None): 296 def IsUserBuild(self, timeout=None, retries=None):
297 """Checks whether or not the device is running a user build. 297 """Checks whether or not the device is running a user build.
298 298
299 Args: 299 Args:
300 timeout: timeout in seconds 300 timeout: timeout in seconds
301 retries: number of retries 301 retries: number of retries
302 302
303 Returns: 303 Returns:
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 blacklist = device_blacklist.ReadBlacklist() 1579 blacklist = device_blacklist.ReadBlacklist()
1580 def blacklisted(adb): 1580 def blacklisted(adb):
1581 if adb.GetDeviceSerial() in blacklist: 1581 if adb.GetDeviceSerial() in blacklist:
1582 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial()) 1582 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial())
1583 return True 1583 return True
1584 return False 1584 return False
1585 1585
1586 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices() 1586 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices()
1587 if not blacklisted(adb)] 1587 if not blacklisted(adb)]
1588 1588
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698