summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlavio Lerda <flerda@google.com>2016-08-02 13:13:51 +0100
committerFlavio Lerda <flerda@google.com>2016-08-02 13:13:51 +0100
commitaac719daa14615b4ac3c2313b6dfee0590698c98 (patch)
treed0055dea7470b0531846ebb4639b0dd632797807 /src
parent0b3eafe09ed13f34855896301b58f50a216934d2 (diff)
downloadandroid_packages_apps_PackageInstaller-aac719daa14615b4ac3c2313b6dfee0590698c98.tar.gz
android_packages_apps_PackageInstaller-aac719daa14615b4ac3c2313b6dfee0590698c98.tar.bz2
android_packages_apps_PackageInstaller-aac719daa14615b4ac3c2313b6dfee0590698c98.zip
Check for permissions after checking for features.
This changelist moves around the check for permissions and features, so that apps that do not have the right features, do not trigger a permission granting notification. Such apps are, for example, MotoConnect and other device-specific apps, that are synced to all devices but should not be installed on devices that do not match. At the moment, these show a permission but installation will fail silently later on. Bug: 30582992 Change-Id: Ia75591d90f2c056378e256f98fe7db61ede4c7b2
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,