summaryrefslogtreecommitdiffstats
path: root/services/core
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-05-11 00:22:59 -0700
committerAdnan Begovic <adnan@cyngn.com>2016-05-11 01:31:18 -0700
commitd77a60f91cce9e14af396e350b4b6f93ffc48596 (patch)
tree56e0f7209fd57259a9867174b67ed416476e01a8 /services/core
parent2d7b91660673f81df32b3f4ce1dfb5b22e02493f (diff)
downloadframeworks_base-d77a60f91cce9e14af396e350b4b6f93ffc48596.zip
frameworks_base-d77a60f91cce9e14af396e350b4b6f93ffc48596.tar.gz
frameworks_base-d77a60f91cce9e14af396e350b4b6f93ffc48596.tar.bz2
am: Don't protect apps that atttempt to grant uri perms.
If an application is delegating uri permissions through the disambiguation dialog, we need to ignore the global protected apps concept to make sure the functionality still works. TODO: Refactor the protected apps implementation to function with startActivityAsCaller within the system process and the android package. TICKET: FEIJ-420 Change-Id: I8ba974a7b25dffe654d32e859064ae86cd9dc7f8
Diffstat (limited to 'services/core')
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 7a3b712..48ac172 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -959,8 +959,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
try {
//TODO: This needs to be a flushed out API in the future.
- if (intent.getComponent() != null && AppGlobals.getPackageManager()
- .isComponentProtected(callingPackage, intent.getComponent(), userId)) {
+ boolean isProtected = intent.getComponent() != null
+ && AppGlobals.getPackageManager()
+ .isComponentProtected(callingPackage, intent.getComponent(), userId) &&
+ (intent.getFlags()&Intent.FLAG_GRANT_READ_URI_PERMISSION) == 0;
+
+ if (isProtected) {
Message msg = mService.mHandler.obtainMessage(
ActivityManagerService.POST_COMPONENT_PROTECTED_MSG);
//Store start flags, userid