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

Commit 827782af authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't modify cached permission info" into oc-mr1-dev

parents ef2e7d27 c80b3b75
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;
        }