Index: build/android/devil/android/device_utils.py |
diff --git a/build/android/devil/android/device_utils.py b/build/android/devil/android/device_utils.py |
index 400c51731a7930b4bd0e7d9b4bf527bd6591b6b5..3a6428748eca21384744b57fd1ee8e5b71d70b70 100644 |
--- a/build/android/devil/android/device_utils.py |
+++ b/build/android/devil/android/device_utils.py |
@@ -543,8 +543,8 @@ class DeviceUtils(object): |
@decorators.WithTimeoutAndRetriesFromInstance( |
min_default_timeout=INSTALL_DEFAULT_TIMEOUT) |
- def Install(self, apk, reinstall=False, permissions=None, timeout=None, |
- retries=None): |
+ def Install(self, apk, allow_downgrade=False, reinstall=False, |
+ permissions=None, timeout=None, retries=None): |
"""Install an APK. |
Noop if an identical APK is already installed. |
@@ -556,20 +556,21 @@ class DeviceUtils(object): |
reinstall: A boolean indicating if we should keep any existing app data. |
timeout: timeout in seconds |
retries: number of retries |
+ allow_downgrade: A boolean indicating if we should allow downgrades. |
jbudorick
2015/12/08 16:44:56
nit: these should be in the order in which they ap
rnephew (Reviews Here)
2015/12/08 16:57:57
Done.
|
Raises: |
CommandFailedError if the installation fails. |
CommandTimeoutError if the installation times out. |
DeviceUnreachableError on missing device. |
""" |
- self._InstallInternal(apk, None, reinstall=reinstall, |
- permissions=permissions) |
+ self._InstallInternal(apk, None, allow_downgrade=allow_downgrade, |
+ reinstall=reinstall, permissions=permissions) |
@decorators.WithTimeoutAndRetriesFromInstance( |
min_default_timeout=INSTALL_DEFAULT_TIMEOUT) |
- def InstallSplitApk(self, base_apk, split_apks, reinstall=False, |
- allow_cached_props=False, permissions=None, timeout=None, |
- retries=None): |
+ def InstallSplitApk(self, base_apk, split_apks, allow_downgrade=False, |
+ reinstall=False, allow_cached_props=False, |
+ permissions=None, timeout=None, retries=None): |
"""Install a split APK. |
Noop if all of the APK splits are already installed. |
@@ -584,6 +585,7 @@ class DeviceUtils(object): |
apk helper. To set no permissions, pass []. |
timeout: timeout in seconds |
retries: number of retries |
+ allow_downgrade: A boolean indicating if we should allow downgrades. |
jbudorick
2015/12/08 16:44:56
nit: same
rnephew (Reviews Here)
2015/12/08 16:57:57
Done.
|
Raises: |
CommandFailedError if the installation fails. |
@@ -593,10 +595,12 @@ class DeviceUtils(object): |
""" |
self._InstallInternal(base_apk, split_apks, reinstall=reinstall, |
allow_cached_props=allow_cached_props, |
- permissions=permissions) |
+ permissions=permissions, |
+ allow_downgrade=allow_downgrade) |
- def _InstallInternal(self, base_apk, split_apks, reinstall=False, |
- allow_cached_props=False, permissions=None): |
+ def _InstallInternal(self, base_apk, split_apks, allow_downgrade=False, |
+ reinstall=False, allow_cached_props=False, |
+ permissions=None): |
if split_apks: |
self._CheckSdkLevel(version_codes.LOLLIPOP) |
@@ -642,9 +646,11 @@ class DeviceUtils(object): |
if split_apks: |
partial = package_name if len(apks_to_install) < len(all_apks) else None |
self.adb.InstallMultiple( |
- apks_to_install, partial=partial, reinstall=reinstall) |
+ apks_to_install, partial=partial, reinstall=reinstall, |
+ allow_downgrade=allow_downgrade) |
else: |
- self.adb.Install(base_apk.path, reinstall=reinstall) |
+ self.adb.Install( |
+ base_apk.path, reinstall=reinstall, allow_downgrade=allow_downgrade) |
if (permissions is None |
and self.build_version_sdk >= version_codes.MARSHMALLOW): |
permissions = base_apk.GetPermissions() |