summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-10-28 04:55:56 -0700
committerLinux Build Service Account <lnxbuild@localhost>2016-10-28 04:55:56 -0700
commit7f3bc87a69368ecdc9a27d8c6a21ee4b2d7fd32f (patch)
treed516e3e68e3fa79650f45cfabf5c8b5deee9d316
parentfafa0d8c4d775fd83d3d08cfabcb82999eb62014 (diff)
parent64d3812bca7c1121a767e8436b433e8b293e0110 (diff)
downloadandroid_packages_apps_PackageInstaller-7f3bc87a69368ecdc9a27d8c6a21ee4b2d7fd32f.zip
android_packages_apps_PackageInstaller-7f3bc87a69368ecdc9a27d8c6a21ee4b2d7fd32f.tar.gz
android_packages_apps_PackageInstaller-7f3bc87a69368ecdc9a27d8c6a21ee4b2d7fd32f.tar.bz2
Promotion of android-framework.lnx.2.0-00016.
CRs Change ID Subject -------------------------------------------------------------------------------------------------------------- 1079155 Ibe8c9064fcd4fdfd33da69d68c145a5108a484d2 Disable permission auto enable in case only disable it u Change-Id: Id4cd6da1602d51a9e6314cd69b37eee7269fcc03 CRs-Fixed: 1079155
-rw-r--r--[-rwxr-xr-x]src/com/android/packageinstaller/permission/model/AppPermissionGroup.java22
-rw-r--r--src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java24
2 files changed, 40 insertions, 6 deletions
diff --git a/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java b/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java
index 2bdae42..aa68959 100755..100644
--- a/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java
+++ b/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java
@@ -286,6 +286,28 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
return mPermissions.get(permission) != null;
}
+ public boolean checkRuntimePermission(String[] filterPermissions) {
+ if (LocationUtils.isLocationGroupAndProvider(mName, mPackageInfo.packageName)) {
+ return LocationUtils.isLocationEnabled(mContext);
+ }
+ final int permissionCount = mPermissions.size();
+ for (int i = 0; i < permissionCount; i++) {
+ Permission permission = mPermissions.valueAt(i);
+ if (filterPermissions != null
+ && !ArrayUtils.contains(filterPermissions, permission.getName())) {
+ continue;
+ }
+ if (mAppSupportsRuntimePermissions) {
+ if (!permission.isGranted()) {
+ return false;
+ }
+ } else if (permission.isGranted() && (permission.getAppOp() == null
+ || permission.isAppOpAllowed())) {
+ return true;
+ }
+ }
+ return false;
+ }
public boolean areRuntimePermissionsGranted() {
return areRuntimePermissionsGranted(null);
}
diff --git a/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java b/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
index 4a4b755..fdb1648 100644
--- a/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
+++ b/src/com/android/packageinstaller/permission/ui/GrantPermissionsActivity.java
@@ -161,12 +161,22 @@ public class GrantPermissionsActivity extends OverlayTouchActivity
break;
default: {
- if (!group.areRuntimePermissionsGranted()) {
- mRequestGrantPermissionGroups.put(group.getName(),
- new GroupState(group));
+ if (AppPermissionGroup.isStrictOpEnable()) {
+ if (!group.checkRuntimePermission(null)) {
+ mRequestGrantPermissionGroups.put(group.getName(),
+ new GroupState(group));
+ } else {
+ group.grantRuntimePermissions(false);
+ updateGrantResults(group);
+ }
} else {
- group.grantRuntimePermissions(false);
- updateGrantResults(group);
+ if (!group.areRuntimePermissionsGranted()) {
+ mRequestGrantPermissionGroups.put(group.getName(),
+ new GroupState(group));
+ } else {
+ group.grantRuntimePermissions(false);
+ updateGrantResults(group);
+ }
}
}
break;
@@ -297,7 +307,9 @@ public class GrantPermissionsActivity extends OverlayTouchActivity
groupState.mGroup.grantRuntimePermissions(doNotAskAgain);
groupState.mState = GroupState.STATE_ALLOWED;
} else {
- groupState.mGroup.revokeRuntimePermissions(doNotAskAgain);
+ if(!AppPermissionGroup.isStrictOpEnable()){
+ groupState.mGroup.revokeRuntimePermissions(doNotAskAgain);
+ }
groupState.mState = GroupState.STATE_DENIED;
}
updateGrantResults(groupState.mGroup);