Merge "Allowing system uid to embed Task on secondary user" into sc-v2-dev am: 8b701b0813

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16003535

Change-Id: I4c9086cdc61599754eddece6b1f2fff06a4e918b
This commit is contained in:
Louis Chang
2021-10-12 06:28:07 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 1 deletions

View File

@@ -501,6 +501,8 @@ public class ActivityStartController {
int startActivityInTaskFragment(@NonNull TaskFragment taskFragment,
@NonNull Intent activityIntent, @Nullable Bundle activityOptions,
@Nullable IBinder resultTo) {
final ActivityRecord caller =
resultTo != null ? ActivityRecord.forTokenLocked(resultTo) : null;
return obtainStarter(activityIntent, "startActivityInTaskFragment")
.setActivityOptions(activityOptions)
.setInTaskFragment(taskFragment)
@@ -508,6 +510,7 @@ public class ActivityStartController {
.setRequestCode(-1)
.setCallingUid(Binder.getCallingUid())
.setCallingPid(Binder.getCallingPid())
.setUserId(caller != null ? caller.mUserId : mService.getCurrentUserId())
.execute();
}

View File

@@ -1979,7 +1979,7 @@ class ActivityStarter {
// Allowing the embedding if the task is owned by system.
final int hostUid = hostTask.effectiveUid;
if (hostUid == Process.SYSTEM_UID) {
if (UserHandle.getAppId(hostUid) == Process.SYSTEM_UID) {
return true;
}