diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 11b9df06e7..3aeab7be29 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -789,7 +789,7 @@ public abstract class AbsSwipeUpHandler, mRecentsAnimationStartCallbacks.clear(); } - TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, false); + TaskViewUtils.setSplitAuxiliarySurfacesShown(mRecentsAnimationTargets.nonApps, false); // Only add the callback to enable the input consumer after we actually have the controller mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED, @@ -806,7 +806,7 @@ public abstract class AbsSwipeUpHandler, mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED); if (mRecentsAnimationTargets != null) { - TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); + TaskViewUtils.setSplitAuxiliarySurfacesShown(mRecentsAnimationTargets.nonApps, true); } // Defer clearing the controller and the targets until after we've updated the state @@ -955,7 +955,8 @@ public abstract class AbsSwipeUpHandler, } else { mStateCallback.setState(STATE_RESUME_LAST_TASK); } - TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); + TaskViewUtils.setSplitAuxiliarySurfacesShown( + mRecentsAnimationTargets.nonApps, true); break; } ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget); @@ -1598,7 +1599,7 @@ public abstract class AbsSwipeUpHandler, mActivityInterface.onTransitionCancelled(wasVisible, mGestureState.getEndTarget()); if (mRecentsAnimationTargets != null) { - TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); + TaskViewUtils.setSplitAuxiliarySurfacesShown(mRecentsAnimationTargets.nonApps, true); } // Leave the pending invisible flag, as it may be used by wallpaper open animation. @@ -1841,7 +1842,7 @@ public abstract class AbsSwipeUpHandler, @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { if (!controller.getFinishTargetIsLauncher()) { - TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); + TaskViewUtils.setSplitAuxiliarySurfacesShown(mRecentsAnimationTargets.nonApps, true); } mRecentsAnimationController = null; mRecentsAnimationTargets = null; diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 37d88ae022..284bc03323 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -35,7 +35,6 @@ import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLAT import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.statehandlers.DepthController.DEPTH; -import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; @@ -505,7 +504,7 @@ public final class TaskViewUtils { nonAppTargets, depthController, pa); if (launcherClosing) { // TODO(b/182592057): differentiate between "restore split" vs "launch fullscreen app" - TaskViewUtils.setDividerBarShown(nonAppTargets, true); + TaskViewUtils.setSplitAuxiliarySurfacesShown(nonAppTargets, true); } Animator childStateAnimation = null; @@ -560,18 +559,20 @@ public final class TaskViewUtils { anim.addListener(windowAnimEndListener); } - static void setDividerBarShown(RemoteAnimationTargetCompat[] nonApps, boolean shown) { + static void setSplitAuxiliarySurfacesShown(RemoteAnimationTargetCompat[] nonApps, + boolean shown) { // TODO(b/182592057): make this part of the animations instead. if (nonApps != null && nonApps.length > 0) { + SurfaceControl.Transaction t = new SurfaceControl.Transaction(); for (int i = 0; i < nonApps.length; ++i) { final RemoteAnimationTargetCompat targ = nonApps[i]; - if (targ.windowType == TYPE_DOCK_DIVIDER) { - SurfaceControl.Transaction t = new SurfaceControl.Transaction(); - t.setVisibility(targ.leash.getSurfaceControl(), shown); - t.apply(); - t.close(); + final SurfaceControl leash = targ.leash.getSurfaceControl(); + if (targ.windowType == TYPE_DOCK_DIVIDER && leash != null) { + t.setVisibility(leash, shown); } } + t.apply(); + t.close(); } } }