Loading quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -743,6 +743,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, mRecentsAnimationStartCallbacks.clear(); mRecentsAnimationStartCallbacks.clear(); } } TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, false); // Only add the callback to enable the input consumer after we actually have the controller // Only add the callback to enable the input consumer after we actually have the controller mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED, mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED, mRecentsAnimationController::enableInputConsumer); mRecentsAnimationController::enableInputConsumer); Loading @@ -757,6 +759,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, mActivityInitListener.unregister(); mActivityInitListener.unregister(); mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED); mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED); TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); // Defer clearing the controller and the targets until after we've updated the state // Defer clearing the controller and the targets until after we've updated the state mRecentsAnimationController = null; mRecentsAnimationController = null; mRecentsAnimationTargets = null; mRecentsAnimationTargets = null; Loading Loading @@ -885,6 +889,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, break; break; case LAST_TASK: case LAST_TASK: mStateCallback.setState(STATE_RESUME_LAST_TASK); mStateCallback.setState(STATE_RESUME_LAST_TASK); TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); break; break; } } ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget); ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget); Loading Loading @@ -1726,6 +1731,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, @Override @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { public void onRecentsAnimationFinished(RecentsAnimationController controller) { if (!controller.getFinishTargetIsLauncher()) { TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); } mRecentsAnimationController = null; mRecentsAnimationController = null; mRecentsAnimationTargets = null; mRecentsAnimationTargets = null; if (mRecentsView != null) { if (mRecentsView != null) { Loading quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import android.graphics.Rect; import android.graphics.Rect; import android.util.ArraySet; import android.util.ArraySet; import android.view.RemoteAnimationTarget; import androidx.annotation.BinderThread; import androidx.annotation.BinderThread; import androidx.annotation.UiThread; import androidx.annotation.UiThread; Loading @@ -39,6 +40,7 @@ public class RecentsAnimationCallbacks implements com.android.systemui.shared.system.RecentsAnimationListener { com.android.systemui.shared.system.RecentsAnimationListener { private final Set<RecentsAnimationListener> mListeners = new ArraySet<>(); private final Set<RecentsAnimationListener> mListeners = new ArraySet<>(); private final SystemUiProxy mSystemUiProxy; private final boolean mAllowMinimizeSplitScreen; private final boolean mAllowMinimizeSplitScreen; // TODO(141886704): Remove these references when they are no longer needed // TODO(141886704): Remove these references when they are no longer needed Loading @@ -46,7 +48,9 @@ public class RecentsAnimationCallbacks implements private boolean mCancelled; private boolean mCancelled; public RecentsAnimationCallbacks(boolean allowMinimizeSplitScreen) { public RecentsAnimationCallbacks(SystemUiProxy systemUiProxy, boolean allowMinimizeSplitScreen) { mSystemUiProxy = systemUiProxy; mAllowMinimizeSplitScreen = allowMinimizeSplitScreen; mAllowMinimizeSplitScreen = allowMinimizeSplitScreen; } } Loading Loading @@ -89,8 +93,11 @@ public class RecentsAnimationCallbacks implements RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets, RemoteAnimationTargetCompat[] wallpaperTargets, Rect homeContentInsets, Rect minimizedHomeBounds) { Rect homeContentInsets, Rect minimizedHomeBounds) { RemoteAnimationTarget[] nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy(mCancelled); RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets, RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets, wallpaperTargets, homeContentInsets, minimizedHomeBounds); wallpaperTargets, RemoteAnimationTargetCompat.wrap(nonAppTargets), homeContentInsets, minimizedHomeBounds); mController = new RecentsAnimationController(animationController, mController = new RecentsAnimationController(animationController, mAllowMinimizeSplitScreen, this::onAnimationFinished); mAllowMinimizeSplitScreen, this::onAnimationFinished); Loading quickstep/src/com/android/quickstep/RecentsAnimationTargets.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -31,9 +31,9 @@ public class RecentsAnimationTargets extends RemoteAnimationTargets { public final Rect minimizedHomeBounds; public final Rect minimizedHomeBounds; public RecentsAnimationTargets(RemoteAnimationTargetCompat[] apps, public RecentsAnimationTargets(RemoteAnimationTargetCompat[] apps, RemoteAnimationTargetCompat[] wallpapers, Rect homeContentInsets, RemoteAnimationTargetCompat[] wallpapers, RemoteAnimationTargetCompat[] nonApps, Rect minimizedHomeBounds) { Rect homeContentInsets, Rect minimizedHomeBounds) { super(apps, wallpapers, new RemoteAnimationTargetCompat[0], MODE_CLOSING); super(apps, wallpapers, nonApps, MODE_CLOSING); this.homeContentInsets = homeContentInsets; this.homeContentInsets = homeContentInsets; this.minimizedHomeBounds = minimizedHomeBounds; this.minimizedHomeBounds = minimizedHomeBounds; } } Loading quickstep/src/com/android/quickstep/SystemUiProxy.java +19 −0 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.os.UserHandle; import android.util.Log; import android.util.Log; import android.view.MotionEvent; import android.view.MotionEvent; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.view.SurfaceControl; import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.MainThreadInitializedObject; Loading Loading @@ -612,6 +613,24 @@ public class SystemUiProxy implements ISystemUiProxy, } } } } /** * Call this when going to recents so that shell can set-up and provide appropriate leashes * for animation (eg. DividerBar). * * @param cancel true if recents starting is being cancelled. * @return RemoteAnimationTargets of windows that need to animate but only exist in shell. */ public RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) { if (mSplitScreen != null) { try { return mSplitScreen.onGoingToRecentsLegacy(cancel); } catch (RemoteException e) { Log.w(TAG, "Failed call onGoingToRecentsLegacy"); } } return null; } // // // One handed // One handed // // Loading quickstep/src/com/android/quickstep/TaskAnimationManager.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,8 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn final BaseActivityInterface activityInterface = gestureState.getActivityInterface(); final BaseActivityInterface activityInterface = gestureState.getActivityInterface(); mLastGestureState = gestureState; mLastGestureState = gestureState; mCallbacks = new RecentsAnimationCallbacks(activityInterface.allowMinimizeSplitScreen()); mCallbacks = new RecentsAnimationCallbacks(SystemUiProxy.INSTANCE.get(mCtx), activityInterface.allowMinimizeSplitScreen()); mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() { mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() { @Override @Override public void onRecentsAnimationStart(RecentsAnimationController controller, public void onRecentsAnimationStart(RecentsAnimationController controller, Loading Loading
quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -743,6 +743,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, mRecentsAnimationStartCallbacks.clear(); mRecentsAnimationStartCallbacks.clear(); } } TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, false); // Only add the callback to enable the input consumer after we actually have the controller // Only add the callback to enable the input consumer after we actually have the controller mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED, mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED, mRecentsAnimationController::enableInputConsumer); mRecentsAnimationController::enableInputConsumer); Loading @@ -757,6 +759,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, mActivityInitListener.unregister(); mActivityInitListener.unregister(); mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED); mStateCallback.setStateOnUiThread(STATE_GESTURE_CANCELLED | STATE_HANDLER_INVALIDATED); TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); // Defer clearing the controller and the targets until after we've updated the state // Defer clearing the controller and the targets until after we've updated the state mRecentsAnimationController = null; mRecentsAnimationController = null; mRecentsAnimationTargets = null; mRecentsAnimationTargets = null; Loading Loading @@ -885,6 +889,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, break; break; case LAST_TASK: case LAST_TASK: mStateCallback.setState(STATE_RESUME_LAST_TASK); mStateCallback.setState(STATE_RESUME_LAST_TASK); TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); break; break; } } ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget); ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget); Loading Loading @@ -1726,6 +1731,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, @Override @Override public void onRecentsAnimationFinished(RecentsAnimationController controller) { public void onRecentsAnimationFinished(RecentsAnimationController controller) { if (!controller.getFinishTargetIsLauncher()) { TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true); } mRecentsAnimationController = null; mRecentsAnimationController = null; mRecentsAnimationTargets = null; mRecentsAnimationTargets = null; if (mRecentsView != null) { if (mRecentsView != null) { Loading
quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import android.graphics.Rect; import android.graphics.Rect; import android.util.ArraySet; import android.util.ArraySet; import android.view.RemoteAnimationTarget; import androidx.annotation.BinderThread; import androidx.annotation.BinderThread; import androidx.annotation.UiThread; import androidx.annotation.UiThread; Loading @@ -39,6 +40,7 @@ public class RecentsAnimationCallbacks implements com.android.systemui.shared.system.RecentsAnimationListener { com.android.systemui.shared.system.RecentsAnimationListener { private final Set<RecentsAnimationListener> mListeners = new ArraySet<>(); private final Set<RecentsAnimationListener> mListeners = new ArraySet<>(); private final SystemUiProxy mSystemUiProxy; private final boolean mAllowMinimizeSplitScreen; private final boolean mAllowMinimizeSplitScreen; // TODO(141886704): Remove these references when they are no longer needed // TODO(141886704): Remove these references when they are no longer needed Loading @@ -46,7 +48,9 @@ public class RecentsAnimationCallbacks implements private boolean mCancelled; private boolean mCancelled; public RecentsAnimationCallbacks(boolean allowMinimizeSplitScreen) { public RecentsAnimationCallbacks(SystemUiProxy systemUiProxy, boolean allowMinimizeSplitScreen) { mSystemUiProxy = systemUiProxy; mAllowMinimizeSplitScreen = allowMinimizeSplitScreen; mAllowMinimizeSplitScreen = allowMinimizeSplitScreen; } } Loading Loading @@ -89,8 +93,11 @@ public class RecentsAnimationCallbacks implements RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets, RemoteAnimationTargetCompat[] wallpaperTargets, Rect homeContentInsets, Rect minimizedHomeBounds) { Rect homeContentInsets, Rect minimizedHomeBounds) { RemoteAnimationTarget[] nonAppTargets = mSystemUiProxy.onGoingToRecentsLegacy(mCancelled); RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets, RecentsAnimationTargets targets = new RecentsAnimationTargets(appTargets, wallpaperTargets, homeContentInsets, minimizedHomeBounds); wallpaperTargets, RemoteAnimationTargetCompat.wrap(nonAppTargets), homeContentInsets, minimizedHomeBounds); mController = new RecentsAnimationController(animationController, mController = new RecentsAnimationController(animationController, mAllowMinimizeSplitScreen, this::onAnimationFinished); mAllowMinimizeSplitScreen, this::onAnimationFinished); Loading
quickstep/src/com/android/quickstep/RecentsAnimationTargets.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -31,9 +31,9 @@ public class RecentsAnimationTargets extends RemoteAnimationTargets { public final Rect minimizedHomeBounds; public final Rect minimizedHomeBounds; public RecentsAnimationTargets(RemoteAnimationTargetCompat[] apps, public RecentsAnimationTargets(RemoteAnimationTargetCompat[] apps, RemoteAnimationTargetCompat[] wallpapers, Rect homeContentInsets, RemoteAnimationTargetCompat[] wallpapers, RemoteAnimationTargetCompat[] nonApps, Rect minimizedHomeBounds) { Rect homeContentInsets, Rect minimizedHomeBounds) { super(apps, wallpapers, new RemoteAnimationTargetCompat[0], MODE_CLOSING); super(apps, wallpapers, nonApps, MODE_CLOSING); this.homeContentInsets = homeContentInsets; this.homeContentInsets = homeContentInsets; this.minimizedHomeBounds = minimizedHomeBounds; this.minimizedHomeBounds = minimizedHomeBounds; } } Loading
quickstep/src/com/android/quickstep/SystemUiProxy.java +19 −0 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.os.UserHandle; import android.util.Log; import android.util.Log; import android.view.MotionEvent; import android.view.MotionEvent; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationTarget; import android.view.SurfaceControl; import android.view.SurfaceControl; import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.MainThreadInitializedObject; Loading Loading @@ -612,6 +613,24 @@ public class SystemUiProxy implements ISystemUiProxy, } } } } /** * Call this when going to recents so that shell can set-up and provide appropriate leashes * for animation (eg. DividerBar). * * @param cancel true if recents starting is being cancelled. * @return RemoteAnimationTargets of windows that need to animate but only exist in shell. */ public RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) { if (mSplitScreen != null) { try { return mSplitScreen.onGoingToRecentsLegacy(cancel); } catch (RemoteException e) { Log.w(TAG, "Failed call onGoingToRecentsLegacy"); } } return null; } // // // One handed // One handed // // Loading
quickstep/src/com/android/quickstep/TaskAnimationManager.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -109,7 +109,8 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn final BaseActivityInterface activityInterface = gestureState.getActivityInterface(); final BaseActivityInterface activityInterface = gestureState.getActivityInterface(); mLastGestureState = gestureState; mLastGestureState = gestureState; mCallbacks = new RecentsAnimationCallbacks(activityInterface.allowMinimizeSplitScreen()); mCallbacks = new RecentsAnimationCallbacks(SystemUiProxy.INSTANCE.get(mCtx), activityInterface.allowMinimizeSplitScreen()); mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() { mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() { @Override @Override public void onRecentsAnimationStart(RecentsAnimationController controller, public void onRecentsAnimationStart(RecentsAnimationController controller, Loading