Loading quickstep/src/com/android/quickstep/InputConsumer.java +10 −0 Original line number Diff line number Diff line Loading @@ -126,4 +126,14 @@ public interface InputConsumer { } return name.toString(); } /** * Returns an input consumer of the given class type, or null if none is found. */ default <T extends InputConsumer> T getInputConsumerOfClass(Class<T> c) { if (getClass().equals(c)) { return c.cast(this); } return null; } } quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +2 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,8 @@ public class RecentsAnimationCallbacks implements /* extras= */ 0, /* gestureEvent= */ ON_START_RECENTS_ANIMATION); notifyAnimationCanceled(); animationController.finish(false /* toHome */, false /* sendUserLeaveHint */); animationController.finish(false /* toHome */, false /* sendUserLeaveHint */, null /* finishCb */); return; } Loading quickstep/src/com/android/quickstep/RecentsAnimationController.java +11 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITION import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.FINISH_RECENTS_ANIMATION; import android.content.Context; import android.os.Bundle; import android.os.RemoteException; import android.util.Log; import android.view.IRecentsAnimationController; Loading @@ -32,6 +33,7 @@ import android.window.PictureInPictureSurfaceTransaction; import androidx.annotation.NonNull; import androidx.annotation.UiThread; import com.android.internal.os.IResultReceiver; import com.android.launcher3.util.Preconditions; import com.android.launcher3.util.RunnableList; import com.android.quickstep.util.ActiveGestureErrorDetector; Loading Loading @@ -172,12 +174,19 @@ public class RecentsAnimationController { mFinishTargetIsLauncher = toRecents; mOnFinishedListener.accept(this); Runnable finishCb = () -> { mController.finish(toRecents, sendUserLeaveHint); mController.finish(toRecents, sendUserLeaveHint, new IResultReceiver.Stub() { @Override public void send(int i, Bundle bundle) throws RemoteException { ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation-callback"); MAIN_EXECUTOR.execute(() -> { mPendingFinishCallbacks.executeAllAndDestroy(); }); } }); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME); InteractionJankMonitorWrapper.end( InteractionJankMonitorWrapper.CUJ_APP_SWIPE_TO_RECENTS); MAIN_EXECUTOR.execute(mPendingFinishCallbacks::executeAllAndDestroy); }; if (forceFinish) { finishCb.run(); Loading quickstep/src/com/android/quickstep/TaskAnimationManager.java +6 −4 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } } // But force-finish it anyways finishRunningRecentsAnimation(false /* toHome */, true /* forceFinish */); finishRunningRecentsAnimation(false /* toHome */, true /* forceFinish */, null /* forceFinishCb */); if (mCallbacks != null) { // If mCallbacks still != null, that means we are getting this startRecentsAnimation() Loading Loading @@ -318,19 +319,20 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn * Finishes the running recents animation. */ public void finishRunningRecentsAnimation(boolean toHome) { finishRunningRecentsAnimation(toHome, false /* forceFinish */); finishRunningRecentsAnimation(toHome, false /* forceFinish */, null /* forceFinishCb */); } /** * Finishes the running recents animation. * @param forceFinish will synchronously finish the controller */ public void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish) { public void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish, Runnable forceFinishCb) { if (mController != null) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "finishRunningRecentsAnimation", toHome); if (forceFinish) { mController.finishController(toHome, null, false /* sendUserLeaveHint */, mController.finishController(toHome, forceFinishCb, false /* sendUserLeaveHint */, true /* forceFinish */); } else { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), toHome Loading quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java +8 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,14 @@ public abstract class DelegateInputConsumer implements InputConsumer { */ protected abstract String getDelegatorName(); @Override public <T extends InputConsumer> T getInputConsumerOfClass(Class<T> c) { if (getClass().equals(c)) { return c.cast(this); } return mDelegate.getInputConsumerOfClass(c); } protected void setActive(MotionEvent ev) { ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(getDelegatorName()) .append(" became active")); Loading Loading
quickstep/src/com/android/quickstep/InputConsumer.java +10 −0 Original line number Diff line number Diff line Loading @@ -126,4 +126,14 @@ public interface InputConsumer { } return name.toString(); } /** * Returns an input consumer of the given class type, or null if none is found. */ default <T extends InputConsumer> T getInputConsumerOfClass(Class<T> c) { if (getClass().equals(c)) { return c.cast(this); } return null; } }
quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +2 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,8 @@ public class RecentsAnimationCallbacks implements /* extras= */ 0, /* gestureEvent= */ ON_START_RECENTS_ANIMATION); notifyAnimationCanceled(); animationController.finish(false /* toHome */, false /* sendUserLeaveHint */); animationController.finish(false /* toHome */, false /* sendUserLeaveHint */, null /* finishCb */); return; } Loading
quickstep/src/com/android/quickstep/RecentsAnimationController.java +11 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITION import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.FINISH_RECENTS_ANIMATION; import android.content.Context; import android.os.Bundle; import android.os.RemoteException; import android.util.Log; import android.view.IRecentsAnimationController; Loading @@ -32,6 +33,7 @@ import android.window.PictureInPictureSurfaceTransaction; import androidx.annotation.NonNull; import androidx.annotation.UiThread; import com.android.internal.os.IResultReceiver; import com.android.launcher3.util.Preconditions; import com.android.launcher3.util.RunnableList; import com.android.quickstep.util.ActiveGestureErrorDetector; Loading Loading @@ -172,12 +174,19 @@ public class RecentsAnimationController { mFinishTargetIsLauncher = toRecents; mOnFinishedListener.accept(this); Runnable finishCb = () -> { mController.finish(toRecents, sendUserLeaveHint); mController.finish(toRecents, sendUserLeaveHint, new IResultReceiver.Stub() { @Override public void send(int i, Bundle bundle) throws RemoteException { ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation-callback"); MAIN_EXECUTOR.execute(() -> { mPendingFinishCallbacks.executeAllAndDestroy(); }); } }); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME); InteractionJankMonitorWrapper.end( InteractionJankMonitorWrapper.CUJ_APP_SWIPE_TO_RECENTS); MAIN_EXECUTOR.execute(mPendingFinishCallbacks::executeAllAndDestroy); }; if (forceFinish) { finishCb.run(); Loading
quickstep/src/com/android/quickstep/TaskAnimationManager.java +6 −4 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn } } // But force-finish it anyways finishRunningRecentsAnimation(false /* toHome */, true /* forceFinish */); finishRunningRecentsAnimation(false /* toHome */, true /* forceFinish */, null /* forceFinishCb */); if (mCallbacks != null) { // If mCallbacks still != null, that means we are getting this startRecentsAnimation() Loading Loading @@ -318,19 +319,20 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn * Finishes the running recents animation. */ public void finishRunningRecentsAnimation(boolean toHome) { finishRunningRecentsAnimation(toHome, false /* forceFinish */); finishRunningRecentsAnimation(toHome, false /* forceFinish */, null /* forceFinishCb */); } /** * Finishes the running recents animation. * @param forceFinish will synchronously finish the controller */ public void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish) { public void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish, Runnable forceFinishCb) { if (mController != null) { ActiveGestureLog.INSTANCE.addLog( /* event= */ "finishRunningRecentsAnimation", toHome); if (forceFinish) { mController.finishController(toHome, null, false /* sendUserLeaveHint */, mController.finishController(toHome, forceFinishCb, false /* sendUserLeaveHint */, true /* forceFinish */); } else { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), toHome Loading
quickstep/src/com/android/quickstep/inputconsumers/DelegateInputConsumer.java +8 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,14 @@ public abstract class DelegateInputConsumer implements InputConsumer { */ protected abstract String getDelegatorName(); @Override public <T extends InputConsumer> T getInputConsumerOfClass(Class<T> c) { if (getClass().equals(c)) { return c.cast(this); } return mDelegate.getInputConsumerOfClass(c); } protected void setActive(MotionEvent ev) { ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(getDelegatorName()) .append(" became active")); Loading