Skip to content

Commit 7300dbe

Browse files
Amith YamasaniAndroid (Google) Code Review
authored andcommitted
Fix launching activity from a pending intent
The creator of the pending intent is the user on which the activity should be launched. Change-Id: I733326ed8a5784985ac93a84ce91de4dda17c730
1 parent 81c304b commit 7300dbe

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

services/java/com/android/server/am/ActivityManagerService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,6 @@ public final int startActivityInPackage(int uid,
25392539

25402540
// This is so super not safe, that only the system (or okay root)
25412541
// can do it.
2542-
int userId = Binder.getOrigCallingUser();
25432542
final int callingUid = Binder.getCallingUid();
25442543
if (callingUid != 0 && callingUid != Process.myUid()) {
25452544
throw new SecurityException(
@@ -2548,7 +2547,7 @@ public final int startActivityInPackage(int uid,
25482547

25492548
int ret = mMainStack.startActivityMayWait(null, uid, intent, resolvedType,
25502549
resultTo, resultWho, requestCode, startFlags,
2551-
null, null, null, null, options, userId);
2550+
null, null, null, null, options, UserHandle.getUserId(uid));
25522551
return ret;
25532552
}
25542553

0 commit comments

Comments
 (0)