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

Unified Diff: build/android/devil/android/device_utils.py

Issue 1388373003: DeviceUtils.Install: Don't re-grant perms when apk hasn't changed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e9d16935ad2fc307b406fb5e8e45b5b7decf4993..2ff5d9359e258769024de66917e90a42357f1cc2 100644
--- a/build/android/devil/android/device_utils.py
+++ b/build/android/devil/android/device_utils.py
@@ -625,6 +625,10 @@ class DeviceUtils(object):
apks_to_install, partial=partial, reinstall=reinstall)
else:
self.adb.Install(base_apk, reinstall=reinstall)
+ if (permissions is None
+ and self.build_version_sdk >= version_codes.MARSHMALLOW):
+ permissions = apk_helper.ApkHelper(base_apk).GetPermissions()
+ self.GrantPermissions(package_name, permissions)
# Upon success, we know the device checksums, but not their paths.
if host_checksums is not None:
self._cache['package_apk_checksums'][package_name] = host_checksums
@@ -633,11 +637,6 @@ class DeviceUtils(object):
# consistent, we explicitly terminate it when skipping the install.
self.ForceStop(package_name)
- if (permissions is None
- and self.build_version_sdk >= version_codes.MARSHMALLOW):
- permissions = apk_helper.ApkHelper(base_apk).GetPermissions()
- self.GrantPermissions(package_name, permissions)
-
@decorators.WithTimeoutAndRetriesFromInstance()
def Uninstall(self, package_name, keep_data=False, timeout=None,
retries=None):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698