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

Commit b2ea137e authored by Svet Ganov's avatar Svet Ganov Committed by Marie Janssen
Browse files

Add Bluetooth toggle prompts - package installer

If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.

Also added a configuration resource which controls whether
permission review mode is enabled. By default it is not and
an OEM can change this via an overlay. For now we also keep
the old mechanism to toggle review mode via a build property
which is still used and will be removed when clients have
transitioned.

bug:28715749

Change-Id: I3783fa99f3fca881a4b60ea1e7c0f68098302ae4
(cherry picked from commit a4027400)
parent cbef403f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -83,7 +83,9 @@ public final class AppPermissions {
    }

    public boolean isReviewRequired() {
        if (!Build.PERMISSIONS_REVIEW_REQUIRED) {
        if (!mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_permissionReviewRequired)
                && !Build.PERMISSIONS_REVIEW_REQUIRED) {
            return false;
        }
        final int groupCount = mGroups.size();
+4 −2
Original line number Diff line number Diff line
@@ -288,8 +288,10 @@ public final class AllAppPermissionsFragment extends SettingsWithHeader {
        return Utils.applyTint(context, icon, android.R.attr.colorControlNormal);
    }

    private static boolean isMutableGranularPermission(String name) {
        if (!Build.PERMISSIONS_REVIEW_REQUIRED) {
    private boolean isMutableGranularPermission(String name) {
        if (!getResources().getBoolean(
                com.android.internal.R.bool.config_permissionReviewRequired)
                && !Build.PERMISSIONS_REVIEW_REQUIRED) {
            return false;
        }
        switch (name) {