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

Commit 28a368d3 authored by Todd Kennedy's avatar Todd Kennedy Committed by android-build-merger
Browse files

Merge "Completely fill in permission info" into pi-dev am: fdc891e2

am: f73695fb

Change-Id: Ia1ca886b361a3769aaefa7b4e9fccb275f735847
parents 5d103259 f73695fb
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -411,17 +411,23 @@ public final class BasePermission {
    }

    public @NonNull PermissionInfo generatePermissionInfo(int adjustedProtectionLevel, int flags) {
        PermissionInfo permissionInfo;
        if (perm != null) {
            final boolean protectionLevelChanged = protectionLevel != adjustedProtectionLevel;
            permissionInfo = PackageParser.generatePermissionInfo(perm, flags);
            if (protectionLevelChanged && permissionInfo == perm.info) {
                // if we return different protection level, don't use the cached info
        if (perm != null && !protectionLevelChanged) {
            return PackageParser.generatePermissionInfo(perm, flags);
                permissionInfo = new PermissionInfo(permissionInfo);
                permissionInfo.protectionLevel = adjustedProtectionLevel;
            }
        final PermissionInfo pi = new PermissionInfo();
        pi.name = name;
        pi.packageName = sourcePackageName;
        pi.nonLocalizedLabel = name;
        pi.protectionLevel = protectionLevelChanged ? adjustedProtectionLevel : protectionLevel;
        return pi;
            return permissionInfo;
        }
        permissionInfo = new PermissionInfo();
        permissionInfo.name = name;
        permissionInfo.packageName = sourcePackageName;
        permissionInfo.nonLocalizedLabel = name;
        permissionInfo.protectionLevel = protectionLevel;
        return permissionInfo;
    }

    public static boolean readLPw(@NonNull Map<String, BasePermission> out,