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

Commit cf79a56c authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Check for singleUser attribute even for persistent apps" into lmp-dev

parents 81fba709 12a1d81d
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -14645,13 +14645,10 @@ public final class ActivityManagerService extends ActivityManagerNative
            }
        } else if ("system".equals(componentProcessName)) {
            result = true;
        } else if (UserHandle.isSameApp(aInfo.uid, Process.PHONE_UID)
                && (flags & ServiceInfo.FLAG_SINGLE_USER) != 0) {
            // Phone app is allowed to export singleuser providers.
            result = true;
        } else {
            // App with pre-defined UID, check if it's a persistent app
            result = (aInfo.flags & ApplicationInfo.FLAG_PERSISTENT) != 0;
        } else if ((flags & ServiceInfo.FLAG_SINGLE_USER) != 0) {
            // Phone app and persistent apps are allowed to export singleuser providers.
            result = UserHandle.isSameApp(aInfo.uid, Process.PHONE_UID)
                    || (aInfo.flags & ApplicationInfo.FLAG_PERSISTENT) != 0;
        }
        if (DEBUG_MU) {
            Slog.v(TAG, "isSingleton(" + componentProcessName + ", " + aInfo