Remove ICS support from build/android/pylib/

BUG=473837

Review URL: https://codereview.chromium.org/1127133004

Cr-Original-Commit-Position: refs/heads/master@{#329224}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 59c8117b4fa8d32377ff70fa25e2f15304e386f3
This commit is contained in:
aurimas 2015-05-11 12:49:51 -07:00 коммит произвёл Commit bot
Родитель 2a90746421
Коммит 98deb4be3a
9 изменённых файлов: 4 добавлений и 78 удалений

Просмотреть файл

@ -247,7 +247,7 @@ def _PushAndLaunchAdbReboot(device, target):
# Launch adb_reboot
logging.info(' Launching adb_reboot ...')
device.RunShellCommand(
[device.GetDevicePieWrapper(), '/data/local/tmp/adb_reboot'],
['/data/local/tmp/adb_reboot'],
check_return=True)

Просмотреть файл

@ -169,8 +169,6 @@ class ANDROID_SDK_VERSION_CODES(object):
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
ICE_CREAM_SANDWICH = 14
ICE_CREAM_SANDWICH_MR1 = 15
JELLY_BEAN = 16
JELLY_BEAN_MR1 = 17
JELLY_BEAN_MR2 = 18

Просмотреть файл

@ -14,9 +14,6 @@ class ContentSettings(dict):
def __init__(self, table, device):
super(ContentSettings, self).__init__()
assert (device.build_version_sdk
>= constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN), (
'ContentSettings supported only on SDK 16 and later')
self._table = table
self._device = device

Просмотреть файл

@ -1534,41 +1534,6 @@ class DeviceUtils(object):
"""
return logcat_monitor.LogcatMonitor(self.adb, *args, **kwargs)
@decorators.WithTimeoutAndRetriesFromInstance()
def GetDevicePieWrapper(self, timeout=None, retries=None):
"""Gets the absolute path to the run_pie wrapper on the device.
We have to build our device executables to be PIE, but they need to be able
to run on versions of android that don't support PIE (i.e. ICS and below).
To do so, we push a wrapper to the device that lets older android versions
run PIE executables. This method pushes that wrapper to the device if
necessary and returns the path to it.
This is exposed publicly to allow clients to write scripts using run_pie
(e.g. md5sum.CalculateDeviceMd5Sum).
Args:
timeout: timeout in seconds
retries: number of retries
Returns:
The path to the PIE wrapper on the device, or an empty string if the
device does not require the wrapper.
"""
if 'run_pie' not in self._cache:
pie = ''
if (self.build_version_sdk <
constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN):
host_pie_path = os.path.join(constants.GetOutDirectory(), 'run_pie')
if not os.path.exists(host_pie_path):
raise device_errors.CommandFailedError('Please build run_pie')
pie = '%s/run_pie' % constants.TEST_EXECUTABLE_DIR
self.adb.Push(host_pie_path, pie)
self._cache['run_pie'] = pie
return self._cache['run_pie']
def GetClientCache(self, client_name):
"""Returns client cache."""
if client_name not in self._client_caches:

Просмотреть файл

@ -731,24 +731,6 @@ class DeviceUtilsRunPipedShellCommandTest(DeviceUtilsTest):
self.assertIs(None, ec.exception.status)
class DeviceUtilsGetDevicePieWrapper(DeviceUtilsTest):
def testGetDevicePieWrapper_jb(self):
with self.assertCall(
self.call.device.build_version_sdk(),
constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN):
self.assertEqual('', self.device.GetDevicePieWrapper())
def testGetDevicePieWrapper_ics(self):
with self.assertCalls(
(self.call.device.build_version_sdk(),
constants.ANDROID_SDK_VERSION_CODES.ICE_CREAM_SANDWICH),
(mock.call.pylib.constants.GetOutDirectory(), '/foo/bar'),
(mock.call.os.path.exists(mock.ANY), True),
(self.call.adb.Push(mock.ANY, mock.ANY), '')):
self.assertNotEqual('', self.device.GetDevicePieWrapper())
@mock.patch('time.sleep', mock.Mock())
class DeviceUtilsKillAllTest(DeviceUtilsTest):

Просмотреть файл

@ -29,16 +29,6 @@ def ConfigureContentSettings(device, desired_settings):
desired_settings: A list of (table, [(key: value), ...]) for all
settings to configure.
"""
try:
sdk_version = device.build_version_sdk
except device_errors.CommandFailedError as exc:
logging.error('Skipping content settings configuration: %s', str(exc))
return
if sdk_version < constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN:
logging.error('Skipping content settings configuration due to outdated sdk')
return
if device.build_type == 'userdebug':
for table, key_value in desired_settings:
settings = content_settings.ContentSettings(table, device)

Просмотреть файл

@ -116,9 +116,8 @@ class TestPackageExecutable(TestPackage):
constants.TEST_EXECUTABLE_DIR, '%s_deps' % self.suite_name)
cmd = []
for wrapper in (device.GetDevicePieWrapper(), self.tool.GetTestWrapper()):
if wrapper:
cmd.append(wrapper)
if self.tool.GetTestWrapper():
cmd.append(self.tool.GetTestWrapper())
cmd.extend([
posixpath.join(constants.TEST_EXECUTABLE_DIR, self.suite_name),
'--gtest_list_tests'])

Просмотреть файл

@ -336,9 +336,6 @@ class TestRunner(base_test_runner.BaseTestRunner):
timeout = (self._GetIndividualTestTimeoutSecs(test) *
self._GetIndividualTestTimeoutScale(test) *
self.tool.GetTimeoutScale())
if (self.device.build_version_sdk
< constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN):
timeout *= 10
start_ms = 0
duration_ms = 0

Просмотреть файл

@ -18,7 +18,7 @@ MD5SUM_DEVICE_BIN_PATH = MD5SUM_DEVICE_LIB_PATH + 'md5sum_bin'
MD5SUM_DEVICE_SCRIPT_FORMAT = (
'test -f {path} -o -d {path} '
'&& LD_LIBRARY_PATH={md5sum_lib} {device_pie_wrapper} {md5sum_bin} {path}')
'&& LD_LIBRARY_PATH={md5sum_lib} {md5sum_bin} {path}')
_STARTS_WITH_CHECKSUM_RE = re.compile(r'^\s*[0-9a-fA-f]{32}\s+')
@ -65,11 +65,9 @@ def CalculateDeviceMd5Sums(paths, device):
with tempfile.NamedTemporaryFile() as md5sum_script_file:
with device_temp_file.DeviceTempFile(
device.adb) as md5sum_device_script_file:
device_pie_wrapper = device.GetDevicePieWrapper()
md5sum_script = (
MD5SUM_DEVICE_SCRIPT_FORMAT.format(
path=p, md5sum_lib=MD5SUM_DEVICE_LIB_PATH,
device_pie_wrapper=device_pie_wrapper,
md5sum_bin=MD5SUM_DEVICE_BIN_PATH)
for p in paths)
md5sum_script_file.write('; '.join(md5sum_script))