Loading quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +8 −6 Original line number Diff line number Diff line Loading @@ -19,8 +19,9 @@ import static android.view.RemoteAnimationTarget.MODE_CLOSING; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.CANCEL_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_CANCEL_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_FINISH_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_START_RECENTS_ANIMATION; import android.graphics.Rect; import android.os.Bundle; Loading Loading @@ -112,7 +113,7 @@ public class RecentsAnimationCallbacks implements ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationStart (canceled)", /* extras= */ 0, /* gestureEvent= */ START_RECENTS_ANIMATION); /* gestureEvent= */ ON_START_RECENTS_ANIMATION); notifyAnimationCanceled(); animationController.finish(false /* toHome */, false /* sendUserLeaveHint */); return; Loading Loading @@ -145,7 +146,7 @@ public class RecentsAnimationCallbacks implements ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationStart", /* extras= */ targets.apps.length, /* gestureEvent= */ START_RECENTS_ANIMATION); /* gestureEvent= */ ON_START_RECENTS_ANIMATION); for (RecentsAnimationListener listener : getListeners()) { listener.onRecentsAnimationStart(mController, targets); } Loading @@ -159,7 +160,7 @@ public class RecentsAnimationCallbacks implements Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationCanceled", /* gestureEvent= */ CANCEL_RECENTS_ANIMATION); /* gestureEvent= */ ON_CANCEL_RECENTS_ANIMATION); for (RecentsAnimationListener listener : getListeners()) { listener.onRecentsAnimationCanceled(thumbnailDatas); } Loading Loading @@ -193,7 +194,8 @@ public class RecentsAnimationCallbacks implements private final void onAnimationFinished(RecentsAnimationController controller) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationFinished"); /* event= */ "RecentsAnimationCallbacks.onAnimationFinished", ON_FINISH_RECENTS_ANIMATION); for (RecentsAnimationListener listener : getListeners()) { listener.onRecentsAnimationFinished(controller); } Loading quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java +51 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ public class ActiveGestureErrorDetector { public enum GestureEvent { MOTION_DOWN, MOTION_UP, MOTION_MOVE, SET_END_TARGET, SET_END_TARGET_HOME, SET_END_TARGET_NEW_TASK, SET_END_TARGET_ALL_APPS, ON_SETTLED_ON_END_TARGET, ON_START_RECENTS_ANIMATION, ON_FINISH_RECENTS_ANIMATION, ON_CANCEL_RECENTS_ANIMATION, START_RECENTS_ANIMATION, FINISH_RECENTS_ANIMATION, CANCEL_RECENTS_ANIMATION, SET_ON_PAGE_TRANSITION_END_CALLBACK, CANCEL_CURRENT_ANIMATION, CLEANUP_SCREENSHOT, SCROLLER_ANIMATION_ABORTED, TASK_APPEARED, EXPECTING_TASK_APPEARED, Loading Loading @@ -226,6 +227,32 @@ public class ActiveGestureErrorDetector { + " couldn't start the recents activity", writer); break; case ON_START_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "ON_START_RECENTS_ANIMATION " + "onAnimationStart callback ran before startRecentsAnimation", writer); break; case ON_CANCEL_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.ON_START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "ON_CANCEL_RECENTS_ANIMATION " + "onAnimationCanceled callback ran before onAnimationStart " + "callback", writer); break; case ON_FINISH_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.ON_START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "ON_FINISH_RECENTS_ANIMATION " + "onAnimationFinished callback ran before onAnimationStart " + "callback", writer); break; case MOTION_DOWN: case SET_END_TARGET: case SET_END_TARGET_HOME: Loading Loading @@ -357,6 +384,30 @@ public class ActiveGestureErrorDetector { /* errorMessage= */ "onTaskAppeared was expected to be called but wasn't.", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains(GestureEvent.START_RECENTS_ANIMATION) && !encounteredEvents.contains(GestureEvent.ON_START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "startRecentAnimation was called but onAnimationStart callback was not", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains(GestureEvent.FINISH_RECENTS_ANIMATION) && !encounteredEvents.contains(GestureEvent.ON_FINISH_RECENTS_ANIMATION), prefix, /* errorMessage= */ "finishController was called but onAnimationFinished callback was not", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains(GestureEvent.CANCEL_RECENTS_ANIMATION) && !encounteredEvents.contains(GestureEvent.ON_CANCEL_RECENTS_ANIMATION), prefix, /* errorMessage= */ "onRecentsAnimationCanceled was called but onAnimationCanceled was not", writer); if (!errorDetected) { writer.println(prefix + "\tNo errors detected."); } Loading Loading
quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +8 −6 Original line number Diff line number Diff line Loading @@ -19,8 +19,9 @@ import static android.view.RemoteAnimationTarget.MODE_CLOSING; import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.CANCEL_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.START_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_CANCEL_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_FINISH_RECENTS_ANIMATION; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.ON_START_RECENTS_ANIMATION; import android.graphics.Rect; import android.os.Bundle; Loading Loading @@ -112,7 +113,7 @@ public class RecentsAnimationCallbacks implements ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationStart (canceled)", /* extras= */ 0, /* gestureEvent= */ START_RECENTS_ANIMATION); /* gestureEvent= */ ON_START_RECENTS_ANIMATION); notifyAnimationCanceled(); animationController.finish(false /* toHome */, false /* sendUserLeaveHint */); return; Loading Loading @@ -145,7 +146,7 @@ public class RecentsAnimationCallbacks implements ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationStart", /* extras= */ targets.apps.length, /* gestureEvent= */ START_RECENTS_ANIMATION); /* gestureEvent= */ ON_START_RECENTS_ANIMATION); for (RecentsAnimationListener listener : getListeners()) { listener.onRecentsAnimationStart(mController, targets); } Loading @@ -159,7 +160,7 @@ public class RecentsAnimationCallbacks implements Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationCanceled", /* gestureEvent= */ CANCEL_RECENTS_ANIMATION); /* gestureEvent= */ ON_CANCEL_RECENTS_ANIMATION); for (RecentsAnimationListener listener : getListeners()) { listener.onRecentsAnimationCanceled(thumbnailDatas); } Loading Loading @@ -193,7 +194,8 @@ public class RecentsAnimationCallbacks implements private final void onAnimationFinished(RecentsAnimationController controller) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog( /* event= */ "RecentsAnimationCallbacks.onAnimationFinished"); /* event= */ "RecentsAnimationCallbacks.onAnimationFinished", ON_FINISH_RECENTS_ANIMATION); for (RecentsAnimationListener listener : getListeners()) { listener.onRecentsAnimationFinished(controller); } Loading
quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java +51 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ public class ActiveGestureErrorDetector { public enum GestureEvent { MOTION_DOWN, MOTION_UP, MOTION_MOVE, SET_END_TARGET, SET_END_TARGET_HOME, SET_END_TARGET_NEW_TASK, SET_END_TARGET_ALL_APPS, ON_SETTLED_ON_END_TARGET, ON_START_RECENTS_ANIMATION, ON_FINISH_RECENTS_ANIMATION, ON_CANCEL_RECENTS_ANIMATION, START_RECENTS_ANIMATION, FINISH_RECENTS_ANIMATION, CANCEL_RECENTS_ANIMATION, SET_ON_PAGE_TRANSITION_END_CALLBACK, CANCEL_CURRENT_ANIMATION, CLEANUP_SCREENSHOT, SCROLLER_ANIMATION_ABORTED, TASK_APPEARED, EXPECTING_TASK_APPEARED, Loading Loading @@ -226,6 +227,32 @@ public class ActiveGestureErrorDetector { + " couldn't start the recents activity", writer); break; case ON_START_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "ON_START_RECENTS_ANIMATION " + "onAnimationStart callback ran before startRecentsAnimation", writer); break; case ON_CANCEL_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.ON_START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "ON_CANCEL_RECENTS_ANIMATION " + "onAnimationCanceled callback ran before onAnimationStart " + "callback", writer); break; case ON_FINISH_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.ON_START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "ON_FINISH_RECENTS_ANIMATION " + "onAnimationFinished callback ran before onAnimationStart " + "callback", writer); break; case MOTION_DOWN: case SET_END_TARGET: case SET_END_TARGET_HOME: Loading Loading @@ -357,6 +384,30 @@ public class ActiveGestureErrorDetector { /* errorMessage= */ "onTaskAppeared was expected to be called but wasn't.", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains(GestureEvent.START_RECENTS_ANIMATION) && !encounteredEvents.contains(GestureEvent.ON_START_RECENTS_ANIMATION), prefix, /* errorMessage= */ "startRecentAnimation was called but onAnimationStart callback was not", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains(GestureEvent.FINISH_RECENTS_ANIMATION) && !encounteredEvents.contains(GestureEvent.ON_FINISH_RECENTS_ANIMATION), prefix, /* errorMessage= */ "finishController was called but onAnimationFinished callback was not", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains(GestureEvent.CANCEL_RECENTS_ANIMATION) && !encounteredEvents.contains(GestureEvent.ON_CANCEL_RECENTS_ANIMATION), prefix, /* errorMessage= */ "onRecentsAnimationCanceled was called but onAnimationCanceled was not", writer); if (!errorDetected) { writer.println(prefix + "\tNo errors detected."); } Loading