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

Commit 7b6dc8af authored by Hai Zhang's avatar Hai Zhang
Browse files

Third refactor for BasePermission.

Make mPermissionInfo non-null and remove duplicate fields, to make
sure we have a single source of truth.

The previous nullness of mPermissionInfo is now equivalently
represented by the boolean field mReconciled.

mPendingPermissionInfo is also removed, which results in a slight
change of behavior but I believe it's okay looking at the logic.

Bug: 158736025
Test: presubmit
Change-Id: Ic346a7c3e2811326da3748368af32153b921476d
parent 0651ff74
Loading
Loading
Loading
Loading
+171 −173

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -411,7 +411,7 @@ public class PermissionManagerService extends IPermissionManager.Stub {
                final SystemConfig.PermissionEntry perm = permConfig.valueAt(i);
                BasePermission bp = mSettings.getPermissionLocked(perm.name);
                if (bp == null) {
                    bp = new BasePermission(perm.name, "android", BasePermission.TYPE_BUILTIN);
                    bp = new BasePermission(perm.name, "android", BasePermission.TYPE_CONFIG);
                    mSettings.putPermissionLocked(perm.name, bp);
                }
                if (perm.gids != null) {
@@ -3300,7 +3300,7 @@ public class PermissionManagerService extends IPermissionManager.Stub {
                        PackageParser.SigningDetails.CertCapabilities.PERMISSION);
        final boolean isVendorPrivilegedPermission = bp.isVendorPrivileged();
        final boolean isPrivilegedPermission = bp.isPrivileged() || isVendorPrivilegedPermission;
        final boolean isOemPermission = bp.isOEM();
        final boolean isOemPermission = bp.isOem();
        if (!allowed && (isPrivilegedPermission || isOemPermission) && pkg.isSystem()) {
            final String permissionName = bp.getName();
            // For updated system applications, a privileged/oem permission