OSDN Git Service

Revert "Ensure ApplicationInfo is for correct user for system/android package."
authorKenny Guy <kennyguy@google.com>
Mon, 8 Sep 2014 18:51:15 +0000 (18:51 +0000)
committerKenny Guy <kennyguy@google.com>
Mon, 8 Sep 2014 18:53:56 +0000 (18:53 +0000)
Cache in ActivityThread means this still doesn't make sure we will
get an ApplicationInfo for the user being requested. So reverting.

This reverts commit 4a3b8aa08d743b28d53b327597abf03a925641f2.

Bug:17002733
Change-Id: Ie40eb31c4074cea09de3d6a41fe38b14e00eb059

core/java/android/app/ContextImpl.java

index cc5c643..91a0aed 100644 (file)
@@ -2121,9 +2121,7 @@ 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"))
-                && user.getIdentifier() == UserHandle.getUserId(
-                        mPackageInfo.getApplicationInfo().uid)) {
+        if (packageName.equals("system") || packageName.equals("android")) {
             return new ContextImpl(this, mMainThread, mPackageInfo, mActivityToken,
                     user, restricted, mDisplay, mOverrideConfiguration);
         }