Consolidate the embedding activity check

So that it can go through the same embedding checks, such as
checking if the task was host by system uid, when adding an
activity on a Task in split.

Bug: 189386461
Bug: 197364677
Test: start partner apps from Settings
Change-Id: Iede880956b73178d075d1305e29fe4fcc057d770
This commit is contained in:
Louis Chang
2021-09-23 21:08:47 +08:00
parent 7bf1e9b7c6
commit 1850ba18fa

View File

@@ -2809,7 +2809,7 @@ class ActivityStarter {
false /* includingEmbeddedTask */);
final TaskFragment taskFragment = top != null ? top.getTaskFragment() : null;
if (taskFragment != null && taskFragment.isEmbedded()
&& task.effectiveUid == mStartActivity.getUid()) {
&& canEmbedActivity(taskFragment, mStartActivity, false /* newTask */, task)) {
// Use the embedded TaskFragment of the top activity as the new parent if the
// activity can be embedded.
newParent = top.getTaskFragment();