Show Task Surface if it will not be organized

When trying to start an Activity in a new Task in an organzied
TaskFragment, the Task is first created in TaskDisplayArea as a root
Task, and then got reparented to the TaskFragment. As a result,
Task#showSurfaceOnCreation() will return false, and there will not be
other call to show its surface.

Now, we show the Task surface if it can no longer be organized.

Fix: 193681081
Test: manually test following the reproduce steps with sample app
Change-Id: Ie3da5f1c789d25bcb828b3f1191867a346a508e8
This commit is contained in:
Chris Li
2021-07-14 19:30:47 -07:00
parent 2f7eef8248
commit f20599b631

View File

@@ -1208,6 +1208,12 @@ class Task extends TaskFragment {
}
if (newParent != null) {
// Surface of Task that will not be organized should be shown by default.
// See Task#showSurfaceOnCreation
if (!mCreatedByOrganizer && !canBeOrganized()) {
getSyncTransaction().show(mSurfaceControl);
}
// TODO: Ensure that this is actually necessary here
// Notify the voice session if required
if (voiceSession != null) {