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

Commit ef965cfa authored by Hai Zhang's avatar Hai Zhang
Browse files

Work around GIDs not applied to APK-in-APEX permissions on first boot.

This causes a small behavioral change that prevents misbehaving normal
apps from being installed, so it's only checked in here to unblock V
feature development on AOSP main but should't be actually shipped
(that's why it has a `Merged-In`).

See also ag/26216413 and ag/26228284.

Bug: 325137277
Bug: 322197421
Test: manually check the GIDs in dumpsys permissionmgr after clean flash
Merged-In: Ied24c45734e7c57ce8ed0d015121675bfcbae54f
Change-Id: If0d63e382cd8b8d088753ce16ac05c315032ec85
parent cb1487b4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -146,6 +146,10 @@ public final class Permission {
        return mPermissionInfo.packageName;
    }

    public boolean isReconciled() {
        return mReconciled;
    }

    public int getType() {
        return mType;
    }
+4 −0
Original line number Diff line number Diff line
@@ -4137,6 +4137,10 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
                    // being uninstalled,
                    continue;
                }
                // Don't remove config permissions and lose their GIDs.
                if (bp.getType() == Permission.TYPE_CONFIG && !bp.isReconciled()) {
                    continue;
                }
                // The target package is the source of the current permission
                // Set to changed for either install or uninstall
                changed = true;