diff options
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 5 | ||||
-rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 4cc5370..28ea006 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -1879,11 +1879,12 @@ public final class ActivityStackSupervisor implements DisplayListener { //TODO: This needs to be a flushed out API in the future. boolean isProtected = intent.getComponent() != null && AppGlobals.getPackageManager() - .isComponentProtected(null, r.launchedFromUid, + .isComponentProtected(sourceRecord == null ? "android" : + sourceRecord.launchedFromPackage, r.launchedFromUid, intent.getComponent(), r.userId) && (intent.getFlags()&Intent.FLAG_GRANT_READ_URI_PERMISSION) == 0; - if (isProtected) { + if (isProtected && r.state == INITIALIZING) { Message msg = mService.mHandler.obtainMessage( ActivityManagerService.POST_COMPONENT_PROTECTED_MSG); //Store start flags, userid diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index adb1be8..4597031 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -17307,10 +17307,9 @@ public class PackageManagerService extends IPackageManager.Stub { } } - if (callingPackage == null && (callingUid == Process.SYSTEM_UID - || fromProtectedComponentUid)) { - if (DEBUG_PROTECTED) Log.d(TAG, "Calling package is android and from system or " + - "protected manager, allow"); + if (TextUtils.equals(callingPackage, "android") && callingUid == Process.SYSTEM_UID + || callingPackage == null && fromProtectedComponentUid) { + if (DEBUG_PROTECTED) Log.d(TAG, "Calling package is android or manager, allow"); return false; } |