From 1b5d055f2ea3823b62d694ded7ec19f18d2b1777 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 6 Apr 2020 19:28:49 -0700 Subject: Keep task hidden until task appeared - If the task is previously not visible or has no visible children at the point when we start controlling it in the task org, hide the task until we send taskAppeared to ensure that the task org can reparent and show it otherwise we could see a flash of the task. This happens mainly from two cases: - when starting a new task with a given win mode, we show it and wait for first draw before notifying the task org - when transitioning into pip from swipe up, the activity is hidden and when it requests to enter pip is made visible again Since we are hiding the task w/ the pending transaction, we also need to defer all task org callbacks until that's applied to ensure proper lifecycle of the calls. - Also skip app transitions for task org tasks for now This reverts commit d2fb07e4f632af9ab16667c58b1c1d40711f1544. Bug: 152809695 Bug: 152134460 Test: Open a bubble, ensure that we don't see the task in fullscreen first. Enter pip, ensure that we don't see flash of the task before SysUI can fade it in. Test: atest PipAnimationControllerTest Test: atest TaskOrganizerTests Test: atest SplitScreenTests Change-Id: I9f1fc5931df1d69a7086c02b633347162cda94bf --- core/java/android/window/TaskOrganizerTaskEmbedder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/java/android/window/TaskOrganizerTaskEmbedder.java') diff --git a/core/java/android/window/TaskOrganizerTaskEmbedder.java b/core/java/android/window/TaskOrganizerTaskEmbedder.java index 2091c9398e95..39a0101bbf59 100644 --- a/core/java/android/window/TaskOrganizerTaskEmbedder.java +++ b/core/java/android/window/TaskOrganizerTaskEmbedder.java @@ -254,7 +254,9 @@ public class TaskOrganizerTaskEmbedder extends TaskEmbedder { mTaskToken = taskInfo.token; mTaskLeash = mTaskToken.getLeash(); mTransaction.reparent(mTaskLeash, mSurfaceControl) - .show(mSurfaceControl).apply(); + .show(mTaskLeash) + .show(mSurfaceControl) + .apply(); if (mPendingNotifyBoundsChanged) { // TODO: Either defer show or hide and synchronize show with the resize notifyBoundsChanged(); -- cgit v1.2.3