From 102c525452be15ca5a139d0dfc86d158ea23218b Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Thu, 23 Sep 2021 18:23:57 +0800 Subject: [PATCH] Modify TaskSnapshotWindow#scheduleRemove MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As code review in CL[1] from sc-dev, we should preserve the previous logic to remove home task snapshot immediately, in order to show latest content as soon as possible for unlocking to home. Note that this CL is to sync the logic CL[1] in sc-dev for the downstream branch (qpr1 and v2, and internal master) [1] I81031f64966b1aeb55cc09f381d4d83ec3460dc9 (sc-dev) Bug: 192065018 Test: ateset StartingSurfaceDrawerTests#\ testRemoveTaskSnapshotWithImeSurfaceWhenOnImeDrawn Test: manual tests by 1) launching Android Message with focusing an editor 2) swiping out to home and launch another apps (e.g. chrome) 3) swiping up to overview, tapping Android Message task 4) verify if IME is flickering after switched back. Change-Id: Ic0cb07504acc11707327360051612df9cce565bd --- .../wm/shell/startingsurface/TaskSnapshotWindow.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java index 72295148f678..2dce20371993 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java @@ -16,6 +16,7 @@ package com.android.wm.shell.startingsurface; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.graphics.Color.WHITE; import static android.graphics.Color.alpha; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; @@ -314,6 +315,12 @@ public class TaskSnapshotWindow { } void scheduleRemove(Runnable onRemove) { + // Show the latest content as soon as possible for unlocking to home. + if (mActivityType == ACTIVITY_TYPE_HOME) { + removeImmediately(); + onRemove.run(); + return; + } if (mScheduledRunnable != null) { mSplashScreenExecutor.removeCallbacks(mScheduledRunnable); mScheduledRunnable = null;