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

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

Issue 1127133004: Remove ICS support from build/android/pylib/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 7 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
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 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 1527
1528 Parameters passed to this function are passed directly to 1528 Parameters passed to this function are passed directly to
1529 |logcat_monitor.LogcatMonitor| and are documented there. 1529 |logcat_monitor.LogcatMonitor| and are documented there.
1530 1530
1531 Args: 1531 Args:
1532 timeout: timeout in seconds 1532 timeout: timeout in seconds
1533 retries: number of retries 1533 retries: number of retries
1534 """ 1534 """
1535 return logcat_monitor.LogcatMonitor(self.adb, *args, **kwargs) 1535 return logcat_monitor.LogcatMonitor(self.adb, *args, **kwargs)
1536 1536
1537 @decorators.WithTimeoutAndRetriesFromInstance()
1538 def GetDevicePieWrapper(self, timeout=None, retries=None):
1539 """Gets the absolute path to the run_pie wrapper on the device.
1540
1541 We have to build our device executables to be PIE, but they need to be able
1542 to run on versions of android that don't support PIE (i.e. ICS and below).
1543 To do so, we push a wrapper to the device that lets older android versions
1544 run PIE executables. This method pushes that wrapper to the device if
1545 necessary and returns the path to it.
1546
1547 This is exposed publicly to allow clients to write scripts using run_pie
1548 (e.g. md5sum.CalculateDeviceMd5Sum).
1549
1550 Args:
1551 timeout: timeout in seconds
1552 retries: number of retries
1553
1554 Returns:
1555 The path to the PIE wrapper on the device, or an empty string if the
1556 device does not require the wrapper.
1557 """
1558 if 'run_pie' not in self._cache:
1559 pie = ''
1560 if (self.build_version_sdk <
1561 constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN):
1562 host_pie_path = os.path.join(constants.GetOutDirectory(), 'run_pie')
1563 if not os.path.exists(host_pie_path):
1564 raise device_errors.CommandFailedError('Please build run_pie')
1565 pie = '%s/run_pie' % constants.TEST_EXECUTABLE_DIR
1566 self.adb.Push(host_pie_path, pie)
1567
1568 self._cache['run_pie'] = pie
1569
1570 return self._cache['run_pie']
1571
1572 def GetClientCache(self, client_name): 1537 def GetClientCache(self, client_name):
1573 """Returns client cache.""" 1538 """Returns client cache."""
1574 if client_name not in self._client_caches: 1539 if client_name not in self._client_caches:
1575 self._client_caches[client_name] = {} 1540 self._client_caches[client_name] = {}
1576 return self._client_caches[client_name] 1541 return self._client_caches[client_name]
1577 1542
1578 def _ClearCache(self): 1543 def _ClearCache(self):
1579 """Clears all caches.""" 1544 """Clears all caches."""
1580 for client in self._client_caches: 1545 for client in self._client_caches:
1581 self._client_caches[client].clear() 1546 self._client_caches[client].clear()
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 blacklist = device_blacklist.ReadBlacklist() 1579 blacklist = device_blacklist.ReadBlacklist()
1615 def blacklisted(adb): 1580 def blacklisted(adb):
1616 if adb.GetDeviceSerial() in blacklist: 1581 if adb.GetDeviceSerial() in blacklist:
1617 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial()) 1582 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial())
1618 return True 1583 return True
1619 return False 1584 return False
1620 1585
1621 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices() 1586 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices()
1622 if not blacklisted(adb)] 1587 if not blacklisted(adb)]
1623 1588
OLDNEW
« no previous file with comments | « build/android/pylib/content_settings.py ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698