diff options
author | Bryce Lee <brycelee@google.com> | 2018-03-15 15:00:01 -0700 |
---|---|---|
committer | Bryce Lee <brycelee@google.com> | 2018-03-15 15:00:01 -0700 |
commit | cdb901b584f5042a781dd0512f79f405e1ce8080 (patch) | |
tree | 74627bc055d980fb90ec9bdcc6e93cd053894d4e | |
parent | a46e4d105905c255af66530c81d93bb71531df46 (diff) |
Clear calling UID before resolving intent types.
By not clearing the uid, the intent type is not resolved and the
activity fails to launch. This change adds the resolve call to the
cleared UID scope, which previously encapsulated the invocation.
Fixes: 73297146
Test: Open images shortcut from secondary user's Downloads launcher
icon.
Change-Id: I656a4dcab962ff716bdd2b39441c07a10d5b8c8a
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 96633da16508..dba10bd8aff8 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -25925,16 +25925,19 @@ public class ActivityManagerService extends IActivityManager.Stub Bundle bOptions) { Preconditions.checkNotNull(intents, "intents"); final String[] resolvedTypes = new String[intents.length]; - for (int i = 0; i < intents.length; i++) { - resolvedTypes[i] = intents[i].resolveTypeIfNeeded(mContext.getContentResolver()); - } // UID of the package on user userId. // "= 0" is needed because otherwise catch(RemoteException) would make it look like // packageUid may not be initialized. int packageUid = 0; final long ident = Binder.clearCallingIdentity(); + try { + for (int i = 0; i < intents.length; i++) { + resolvedTypes[i] = + intents[i].resolveTypeIfNeeded(mContext.getContentResolver()); + } + packageUid = AppGlobals.getPackageManager().getPackageUid( packageName, PackageManager.MATCH_DEBUG_TRIAGED_MISSING, userId); } catch (RemoteException e) { |