summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlavio Lerda <flerda@google.com>2016-08-19 17:51:24 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-08-19 17:51:24 +0000
commita0b2858bfdd3439366d15f943847fb1bfdbdb649 (patch)
tree0651f89adbf9d2b9c8cd2c8f5e33ebbdfb8f76eb /src
parent8ac3eb06179971f2e697cb613d0b1236e8de5932 (diff)
parentaac719daa14615b4ac3c2313b6dfee0590698c98 (diff)
downloadandroid_packages_apps_PackageInstaller-a0b2858bfdd3439366d15f943847fb1bfdbdb649.tar.gz
android_packages_apps_PackageInstaller-a0b2858bfdd3439366d15f943847fb1bfdbdb649.tar.bz2
android_packages_apps_PackageInstaller-a0b2858bfdd3439366d15f943847fb1bfdbdb649.zip
Merge "Check for permissions after checking for features." into cw-f-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/packageinstaller/wear/WearPackageInstallerService.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/packageinstaller/wear/WearPackageInstallerService.java b/src/com/android/packageinstaller/wear/WearPackageInstallerService.java
index 2d4744c2..443aa89f 100644
--- a/src/com/android/packageinstaller/wear/WearPackageInstallerService.java
+++ b/src/com/android/packageinstaller/wear/WearPackageInstallerService.java
@@ -298,16 +298,6 @@ public class WearPackageInstallerService extends Service {
}
}
- // Check permissions on both the new wearable package and also on the already installed
- // wearable package.
- // If the app is targeting API level 23, we will also start a service in ClockworkHome
- // which will ultimately prompt the user to accept/reject permissions.
- if (checkPerms && !checkPermissions(pkg, companionSdkVersion, companionDeviceVersion,
- permUri, wearablePerms, tempFile)) {
- Log.w(TAG, "Wearable does not have enough permissions.");
- return;
- }
-
// Check that the wearable has all the features.
boolean hasAllFeatures = true;
if (pkg.reqFeatures != null) {
@@ -325,6 +315,16 @@ public class WearPackageInstallerService extends Service {
return;
}
+ // Check permissions on both the new wearable package and also on the already installed
+ // wearable package.
+ // If the app is targeting API level 23, we will also start a service in ClockworkHome
+ // which will ultimately prompt the user to accept/reject permissions.
+ if (checkPerms && !checkPermissions(pkg, companionSdkVersion, companionDeviceVersion,
+ permUri, wearablePerms, tempFile)) {
+ Log.w(TAG, "Wearable does not have enough permissions.");
+ return;
+ }
+
// Finally install the package.
ParcelFileDescriptor fd = getContentResolver().openFileDescriptor(assetUri, "r");
PackageInstallerFactory.getPackageInstaller(this).install(packageName, fd,