From 04bceb99f12d4abd63d547cbb29602539197b548 Mon Sep 17 00:00:00 2001 From: lumark Date: Sat, 7 Mar 2020 00:03:33 +0800 Subject: Trigger onTaskAppeared when a task started from recents becomes ready. In quick switch flows, launcher will first swipe task snapshot through recents animation, and then start new task with custom animation options through startActivityFromRecents after gesture finish detected, and then finish recents animation finally. But that way user may experience flickering before the new task launch and recents animation finish. To improve quick switch flickering, we ignore the new task's custom animation from recents and generate task remote animation target, and then trigger a callback for launcher to control/animate this task surface, more like a part of RecentsAnimation, Also, adding removeTask method for launcher can flexibility remove the new task animation target once no need to animate, so that launcher can decide when to finish recents animation. Bug: 152480470 Test: manual as below steps: 1) Doing quick switch task. 2) Make sure launcher can receive onTaskAppeared callback. 3) Make sure launcher calls removeTask successfully. 4) Make sure launcher can finish recents animation after 3). Change-Id: I0692a280a49719229fa8871509bad37a1343a00f --- .../perftests/core/src/android/wm/RecentsAnimationPerfTest.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apct-tests') diff --git a/apct-tests/perftests/core/src/android/wm/RecentsAnimationPerfTest.java b/apct-tests/perftests/core/src/android/wm/RecentsAnimationPerfTest.java index 73b4a1914ad1..836e6b617395 100644 --- a/apct-tests/perftests/core/src/android/wm/RecentsAnimationPerfTest.java +++ b/apct-tests/perftests/core/src/android/wm/RecentsAnimationPerfTest.java @@ -192,6 +192,11 @@ public class RecentsAnimationPerfTest extends WindowManagerPerfTestBase { Assume.assumeNoException( new AssertionError("onAnimationCanceled should not be called")); } + + @Override + public void onTaskAppeared(RemoteAnimationTarget app) throws RemoteException { + /* no-op */ + } }; recentsSemaphore.tryAcquire(); -- cgit v1.2.3