Merge "Allowing system uid to embed Task on secondary user" into sc-v2-dev
This commit is contained in:
@@ -501,6 +501,8 @@ public class ActivityStartController {
|
|||||||
int startActivityInTaskFragment(@NonNull TaskFragment taskFragment,
|
int startActivityInTaskFragment(@NonNull TaskFragment taskFragment,
|
||||||
@NonNull Intent activityIntent, @Nullable Bundle activityOptions,
|
@NonNull Intent activityIntent, @Nullable Bundle activityOptions,
|
||||||
@Nullable IBinder resultTo) {
|
@Nullable IBinder resultTo) {
|
||||||
|
final ActivityRecord caller =
|
||||||
|
resultTo != null ? ActivityRecord.forTokenLocked(resultTo) : null;
|
||||||
return obtainStarter(activityIntent, "startActivityInTaskFragment")
|
return obtainStarter(activityIntent, "startActivityInTaskFragment")
|
||||||
.setActivityOptions(activityOptions)
|
.setActivityOptions(activityOptions)
|
||||||
.setInTaskFragment(taskFragment)
|
.setInTaskFragment(taskFragment)
|
||||||
@@ -508,6 +510,7 @@ public class ActivityStartController {
|
|||||||
.setRequestCode(-1)
|
.setRequestCode(-1)
|
||||||
.setCallingUid(Binder.getCallingUid())
|
.setCallingUid(Binder.getCallingUid())
|
||||||
.setCallingPid(Binder.getCallingPid())
|
.setCallingPid(Binder.getCallingPid())
|
||||||
|
.setUserId(caller != null ? caller.mUserId : mService.getCurrentUserId())
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1979,7 +1979,7 @@ class ActivityStarter {
|
|||||||
|
|
||||||
// Allowing the embedding if the task is owned by system.
|
// Allowing the embedding if the task is owned by system.
|
||||||
final int hostUid = hostTask.effectiveUid;
|
final int hostUid = hostTask.effectiveUid;
|
||||||
if (hostUid == Process.SYSTEM_UID) {
|
if (UserHandle.getAppId(hostUid) == Process.SYSTEM_UID) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user