Fix split root removed accidentally

While handleStartResult, if it start unsucessful, the root task might
be remove and cause split root removed accidentally. It will cause
crash next time active split screen. We should avoid the task removed
here if it is creadted by organizer.

Bug: 234406935
Test: manual
Test: pass existing tests
Change-Id: I383682625fa0b90ec8d59873f813ed46162eef12
This commit is contained in:
Tony Huang
2022-06-01 16:30:44 +08:00
parent 96f3ac3bc2
commit 8fb82cdb5d

View File

@@ -89,7 +89,6 @@ import android.app.PendingIntent;
import android.app.ProfilerInfo;
import android.app.WaitResult;
import android.app.WindowConfiguration;
import android.app.compat.CompatChanges;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledSince;
import android.content.ComponentName;
@@ -1693,7 +1692,8 @@ class ActivityStarter {
// Root task should also be detached from display and be removed if it's empty.
if (startedActivityRootTask != null && startedActivityRootTask.isAttached()
&& !startedActivityRootTask.hasActivity()
&& !startedActivityRootTask.isActivityTypeHome()) {
&& !startedActivityRootTask.isActivityTypeHome()
&& !startedActivityRootTask.mCreatedByOrganizer) {
startedActivityRootTask.removeIfPossible("handleStartResult");
}
if (newTransition != null) {