Fixes un-setting activity type when embed activity in split-screen
An exception was thrown by launching the split-screen from the recent
app. It happens while embedding activities in split-screen. System
reparent the tasks from split-root to displayArea when return to home
screen. The reparent’s action is ignored while dealing with the task
whose activity’s type is TYPE_UNDEFINED. Split-screen shell expects
the task of activityType is TYPE_STANDARD. That’s why the system
throws the legal argument exception because the task is already a
child of the root task.
The CL looks for the top non-finish activity first before the top
child in the task for resolving the task activity type. For example,
when add child into TaskFrag#2, this CL resolve the activity type
from activity#1 of Task#49.
-- Task#49
-- TaskFrag#2
-- activity#2
-- TaskFrag#1
-- activity#1
Bug: 228592780
Test: 1.Drag settings from taskbar into split and launch DWB
2.Return to home and launch the split-screen.
Change-Id: I69960b34c909071ce0cce5ff11c630faf6106f6c
This commit is contained in:
@@ -2144,7 +2144,8 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
||||
if (applicationType != ACTIVITY_TYPE_UNDEFINED || !hasChild()) {
|
||||
return applicationType;
|
||||
}
|
||||
return getTopChild().getActivityType();
|
||||
final ActivityRecord activity = getTopNonFinishingActivity();
|
||||
return activity != null ? activity.getActivityType() : getTopChild().getActivityType();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user