Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57c66403 authored by Paul Navin's avatar Paul Navin
Browse files

Use PackageManager query instead of permissions review mode booleans.

There are currently two configuration booleans for permissions review
mode: (1) a Build flag, and (2) a system config boolean. ag/1835531
added a query to PackageManager to hide these, so this CL changes the
usages within PackageInstaller to use this query instead of the booleans
directly.

BUG: 35028846
TEST: Run permissions CTS tests on Nexus 6.
Merged-In: I84516ba39be0de2bfdc953670dc54d5bd761b3a5
Change-Id: I6bb2543a10b28de1bf850126a27a4b1bd111934b
parent 21aa367b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -83,9 +83,7 @@ public final class AppPermissions {
    }

    public boolean isReviewRequired() {
        if (!mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_permissionReviewRequired)
                && !Build.PERMISSIONS_REVIEW_REQUIRED) {
        if (!mContext.getPackageManager().isPermissionReviewModeEnabled()) {
            return false;
        }
        final int groupCount = mGroups.size();
+1 −3
Original line number Diff line number Diff line
@@ -289,9 +289,7 @@ public final class AllAppPermissionsFragment extends SettingsWithHeader {
    }

    private boolean isMutableGranularPermission(String name) {
        if (!getResources().getBoolean(
                com.android.internal.R.bool.config_permissionReviewRequired)
                && !Build.PERMISSIONS_REVIEW_REQUIRED) {
        if (!getContext().getPackageManager().isPermissionReviewModeEnabled()) {
            return false;
        }
        switch (name) {
+1 −2
Original line number Diff line number Diff line
@@ -147,8 +147,7 @@ public final class Utils {
    }

    public static boolean areGroupPermissionsIndividuallyControlled(Context context, String group) {
        if (!context.getResources().getBoolean(
                com.android.internal.R.bool.config_permissionReviewRequired)) {
        if (!context.getPackageManager().isPermissionReviewModeEnabled()) {
            return false;
        }
        return Manifest.permission_group.SMS.equals(group)