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

Commit 6a28a8d5 authored by Kenny Guy's avatar Kenny Guy Committed by Android (Google) Code Review
Browse files

Merge "Ensure ApplicationInfo is for correct user for system/android package." into lmp-dev

parents 2dbf3eac 6df8d523
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2121,7 +2121,9 @@ class ContextImpl extends Context {
    public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
            throws NameNotFoundException {
        final boolean restricted = (flags & CONTEXT_RESTRICTED) == CONTEXT_RESTRICTED;
        if (packageName.equals("system") || packageName.equals("android")) {
        if ((packageName.equals("system") || packageName.equals("android"))
                && user.getIdentifier() == UserHandle.getUserId(
                        mPackageInfo.getApplicationInfo().uid)) {
            return new ContextImpl(this, mMainThread, mPackageInfo, mActivityToken,
                    user, restricted, mDisplay, mOverrideConfiguration);
        }