From e164995f9eb44f2cee89943d497ce452c15f19b5 Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Mon, 13 Jun 2022 12:09:35 -0700 Subject: [PATCH 1/2] Fix taskbar unstash animation delay when launching a split task. Fixes: 232033354 Test: switched between split and unsplit tasks using 3 button nav and gesture nav Change-Id: I9a4e2eb08e9970540093e3dc60b64a372be2052f --- .../taskbar/TaskbarLauncherStateController.java | 7 +++---- .../src/com/android/quickstep/TaskViewUtils.java | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index dc0ef27ba1..3952d20e0a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -169,10 +169,8 @@ import java.util.function.Supplier; mTaskBarRecentsAnimationListener = new TaskBarRecentsAnimationListener(callbacks); callbacks.addListener(mTaskBarRecentsAnimationListener); - RecentsView recentsView = mLauncher.getOverviewPanel(); - recentsView.setTaskLaunchListener(() -> { - mTaskBarRecentsAnimationListener.endGestureStateOverride(true); - }); + ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchListener(() -> + mTaskBarRecentsAnimationListener.endGestureStateOverride(true)); return animatorSet; } @@ -459,6 +457,7 @@ import java.util.function.Supplier; private void endGestureStateOverride(boolean finishedToApp) { mCallbacks.removeListener(this); mTaskBarRecentsAnimationListener = null; + ((RecentsView) mLauncher.getOverviewPanel()).setTaskLaunchListener(null); // Update the resumed state immediately to ensure a seamless handoff boolean launcherResumed = !finishedToApp; diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index db402aff85..a0305688af 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -468,7 +468,6 @@ public final class TaskViewUtils { animatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - super.onAnimationEnd(animation); finishCallback.run(); } }); @@ -530,7 +529,6 @@ public final class TaskViewUtils { for (SurfaceControl leash: closingTargets) { t.hide(leash); } - super.onAnimationEnd(animation); finishCallback.run(); } }); @@ -599,8 +597,13 @@ public final class TaskViewUtils { launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); launcherAnim.setDuration(RECENTS_LAUNCH_DURATION); - // Make sure recents gets fixed up by resetting task alphas and scales, etc. windowAnimEndListener = new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animation) { + recentsView.onTaskLaunchedInLiveTileMode(); + } + + // Make sure recents gets fixed up by resetting task alphas and scales, etc. @Override public void onAnimationEnd(Animator animation) { recentsView.finishRecentsAnimation(false /* toRecents */, () -> { @@ -677,7 +680,6 @@ public final class TaskViewUtils { dockFadeAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { - super.onAnimationStart(animation); if (shown) { for (SurfaceControl leash : auxiliarySurfaces) { t.setAlpha(leash, 0); @@ -689,7 +691,6 @@ public final class TaskViewUtils { @Override public void onAnimationEnd(Animator animation) { - super.onAnimationEnd(animation); if (!shown) { for (SurfaceControl leash : auxiliarySurfaces) { t.hide(leash); From b065b4b05a141e3a1172f3be7f85f619b2d00756 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 17 Jun 2022 09:34:12 +0000 Subject: [PATCH 2/2] Revert "Add logs for InvariantDeviceProfile.getDeviceProfile" This reverts commit d3e8cc40b49741af8457985d711e092794d5cc94. Reason for revert: b/231312158 is fixed, log is no longer needed Fix: 231851651 Change-Id: I3ea8b9d14e7eb6f8f9c794c5d15cdfc94153d392 --- .../android/launcher3/InvariantDeviceProfile.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 73ca4a34c4..dacbe9254a 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -61,8 +61,6 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; @@ -634,18 +632,6 @@ public class InvariantDeviceProfile { float screenHeight = config.screenHeightDp * res.getDisplayMetrics().density; int rotation = WindowManagerProxy.INSTANCE.get(context).getRotation(context); - if (Utilities.IS_DEBUG_DEVICE) { - StringWriter stringWriter = new StringWriter(); - PrintWriter printWriter = new PrintWriter(stringWriter); - DisplayController.INSTANCE.get(context).dump(printWriter); - printWriter.flush(); - Log.d("b/231312158", "getDeviceProfile -" - + "\nconfig: " + config - + "\ndisplayMetrics: " + res.getDisplayMetrics() - + "\nrotation: " + rotation - + "\n" + stringWriter, - new Exception()); - } return getBestMatch(screenWidth, screenHeight, rotation); }