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

Commit 2aed5e9b authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by android-build-merger
Browse files

Merge "Don't modify cached permission info" into oc-mr1-dev am: 827782af

am: af8a8442

Change-Id: I1d00e2fcc22ad45b0efff20eb128f212cdda77b7
parents 9467feba af8a8442
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -4246,10 +4246,17 @@ public class PackageManagerService extends IPackageManager.Stub
                return null;
            }
            // If the caller is an app that targets pre 26 SDK drop protection flags.
            final PermissionInfo permissionInfo = generatePermissionInfo(p, flags);
            PermissionInfo permissionInfo = generatePermissionInfo(p, flags);
            if (permissionInfo != null) {
                permissionInfo.protectionLevel = adjustPermissionProtectionFlagsLPr(
                final int protectionLevel = adjustPermissionProtectionFlagsLPr(
                        permissionInfo.protectionLevel, packageName, callingUid);
                if (permissionInfo.protectionLevel != protectionLevel) {
                    // If we return different protection level, don't use the cached info
                    if (p.perm != null && p.perm.info == permissionInfo) {
                        permissionInfo = new PermissionInfo(permissionInfo);
                    }
                    permissionInfo.protectionLevel = protectionLevel;
                }
            }
            return permissionInfo;
        }