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

Commit 44689865 authored by Svet Ganov's avatar Svet Ganov
Browse files

Expose removed permissions flag as system API - installer

There are some permissions that were removed from the platform
and guard nothing but legacy apps may be checking them before
calling APIs. Hence, these apps should get the permissions as
expected despite them being a no-op. To address this the platform
declares removed permissions as normal permissions that are hidden
such that legacy apps can always get them. These permissions are
not shown in the UI. Play needs a way to filter out these
permissions like the platform as they have permissions UI too.

bug:23361760

Change-Id: Ieecf69f70551d987f5fac1f128b7f7a0c242c378
parent 8c73974b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>

        if (permissionInfo.protectionLevel != PermissionInfo.PROTECTION_DANGEROUS
                || (permissionInfo.flags & PermissionInfo.FLAG_INSTALLED) == 0
                || (permissionInfo.flags & PermissionInfo.FLAG_HIDDEN) != 0) {
                || (permissionInfo.flags & PermissionInfo.FLAG_REMOVED) != 0) {
            return null;
        }

+1 −2
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import com.android.packageinstaller.R;
import com.android.packageinstaller.permission.utils.Utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

@@ -182,7 +181,7 @@ public class PermissionApps {
                            || (requestedPermissionInfo.flags
                                & PermissionInfo.FLAG_INSTALLED) == 0
                            || (requestedPermissionInfo.flags
                                & PermissionInfo.FLAG_HIDDEN) != 0) {
                                & PermissionInfo.FLAG_REMOVED) != 0) {
                        continue;
                    }

+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ public final class PermissionGroups implements LoaderCallbacks<List<PermissionGr
                    seenPermissions.add(groupPermission.name);
                    if (groupPermission.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS
                            && (groupPermission.flags & PermissionInfo.FLAG_INSTALLED) != 0
                            && (groupPermission.flags & PermissionInfo.FLAG_HIDDEN) == 0) {
                            && (groupPermission.flags & PermissionInfo.FLAG_REMOVED) == 0) {
                        hasRuntimePermissions = true;
                    }
                }
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public final class AllAppPermissionsFragment extends SettingsWithHeader {
                    }

                    if ((perm.flags & PermissionInfo.FLAG_INSTALLED) == 0
                            || (perm.flags & PermissionInfo.FLAG_HIDDEN) != 0) {
                            || (perm.flags & PermissionInfo.FLAG_REMOVED) != 0) {
                        continue;
                    }

+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ public final class AllAppPermissionsFragment extends SettingsWithHeader {
                }

                if ((perm.flags & PermissionInfo.FLAG_INSTALLED) == 0
                        || (perm.flags & PermissionInfo.FLAG_HIDDEN) != 0) {
                        || (perm.flags & PermissionInfo.FLAG_REMOVED) != 0) {
                    continue;
                }