Loading quickstep/src/com/android/quickstep/GestureState.java +7 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERV import static com.android.quickstep.MultiStateCallback.DEBUG_STATES; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_HOME; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_LAST_TASK; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_NEW_TASK; import android.annotation.Nullable; import android.annotation.TargetApi; Loading Loading @@ -335,9 +337,13 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL case HOME: ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_HOME); break; case RECENTS: case NEW_TASK: ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_NEW_TASK); break; case LAST_TASK: ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_LAST_TASK); break; case RECENTS: default: // No-Op } Loading quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.annotation.UiThread; import com.android.launcher3.Utilities; import com.android.launcher3.util.Preconditions; import com.android.quickstep.util.ActiveGestureErrorDetector; import com.android.quickstep.util.ActiveGestureLog; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; Loading Loading @@ -137,7 +138,8 @@ public class RecentsAnimationCallbacks implements @Override public void onTasksAppeared(RemoteAnimationTargetCompat[] apps) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog("onTasksAppeared"); ActiveGestureLog.INSTANCE.addLog("onTasksAppeared", ActiveGestureErrorDetector.GestureEvent.TASK_APPEARED); for (RecentsAnimationListener listener : getListeners()) { listener.onTasksAppeared(apps); } Loading quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java +28 −4 Original line number Diff line number Diff line Loading @@ -33,10 +33,10 @@ public class ActiveGestureErrorDetector { * Enums associated to gesture navigation events. */ public enum GestureEvent { MOTION_DOWN, MOTION_UP, SET_END_TARGET, SET_END_TARGET_HOME, ON_SETTLED_ON_END_TARGET, START_RECENTS_ANIMATION, FINISH_RECENTS_ANIMATION, CANCEL_RECENTS_ANIMATION, SET_ON_PAGE_TRANSITION_END_CALLBACK, CANCEL_CURRENT_ANIMATION, CLEANUP_SCREENSHOT, SCROLLER_ANIMATION_ABORTED, MOTION_DOWN, MOTION_UP, SET_END_TARGET, SET_END_TARGET_HOME, SET_END_TARGET_LAST_TASK, SET_END_TARGET_NEW_TASK, ON_SETTLED_ON_END_TARGET, 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, /** * These GestureEvents are specifically associated to state flags that get set in Loading Loading @@ -134,6 +134,15 @@ public class ActiveGestureErrorDetector { + " settling on end target.", writer); break; case TASK_APPEARED: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.SET_END_TARGET_LAST_TASK) && !encounteredEvents.contains( GestureEvent.SET_END_TARGET_NEW_TASK), /* errorMessage= */ prefix + "\t\tonTasksAppeared called " + "before/without setting end target to last or new task", writer); break; case STATE_GESTURE_COMPLETED: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.MOTION_UP), Loading Loading @@ -289,6 +298,21 @@ public class ActiveGestureErrorDetector { + "the task screenshot wasn't cleaned up.", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains( GestureEvent.SET_END_TARGET_LAST_TASK) && !encounteredEvents.contains(GestureEvent.TASK_APPEARED), /* errorMessage= */ prefix + "\t\tend target set to last task, but " + "onTaskAppeared wasn't called.", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains( GestureEvent.SET_END_TARGET_NEW_TASK) && !encounteredEvents.contains(GestureEvent.TASK_APPEARED), /* errorMessage= */ prefix + "\t\tend target set to new task, but " + "onTaskAppeared wasn't called.", writer); if (!errorDetected) { writer.println(prefix + "\t\tNo errors detected."); } Loading Loading
quickstep/src/com/android/quickstep/GestureState.java +7 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERV import static com.android.quickstep.MultiStateCallback.DEBUG_STATES; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_HOME; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_LAST_TASK; import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.SET_END_TARGET_NEW_TASK; import android.annotation.Nullable; import android.annotation.TargetApi; Loading Loading @@ -335,9 +337,13 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL case HOME: ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_HOME); break; case RECENTS: case NEW_TASK: ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_NEW_TASK); break; case LAST_TASK: ActiveGestureLog.INSTANCE.trackEvent(SET_END_TARGET_LAST_TASK); break; case RECENTS: default: // No-Op } Loading
quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.annotation.UiThread; import com.android.launcher3.Utilities; import com.android.launcher3.util.Preconditions; import com.android.quickstep.util.ActiveGestureErrorDetector; import com.android.quickstep.util.ActiveGestureLog; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; Loading Loading @@ -137,7 +138,8 @@ public class RecentsAnimationCallbacks implements @Override public void onTasksAppeared(RemoteAnimationTargetCompat[] apps) { Utilities.postAsyncCallback(MAIN_EXECUTOR.getHandler(), () -> { ActiveGestureLog.INSTANCE.addLog("onTasksAppeared"); ActiveGestureLog.INSTANCE.addLog("onTasksAppeared", ActiveGestureErrorDetector.GestureEvent.TASK_APPEARED); for (RecentsAnimationListener listener : getListeners()) { listener.onTasksAppeared(apps); } Loading
quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java +28 −4 Original line number Diff line number Diff line Loading @@ -33,10 +33,10 @@ public class ActiveGestureErrorDetector { * Enums associated to gesture navigation events. */ public enum GestureEvent { MOTION_DOWN, MOTION_UP, SET_END_TARGET, SET_END_TARGET_HOME, ON_SETTLED_ON_END_TARGET, START_RECENTS_ANIMATION, FINISH_RECENTS_ANIMATION, CANCEL_RECENTS_ANIMATION, SET_ON_PAGE_TRANSITION_END_CALLBACK, CANCEL_CURRENT_ANIMATION, CLEANUP_SCREENSHOT, SCROLLER_ANIMATION_ABORTED, MOTION_DOWN, MOTION_UP, SET_END_TARGET, SET_END_TARGET_HOME, SET_END_TARGET_LAST_TASK, SET_END_TARGET_NEW_TASK, ON_SETTLED_ON_END_TARGET, 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, /** * These GestureEvents are specifically associated to state flags that get set in Loading Loading @@ -134,6 +134,15 @@ public class ActiveGestureErrorDetector { + " settling on end target.", writer); break; case TASK_APPEARED: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.SET_END_TARGET_LAST_TASK) && !encounteredEvents.contains( GestureEvent.SET_END_TARGET_NEW_TASK), /* errorMessage= */ prefix + "\t\tonTasksAppeared called " + "before/without setting end target to last or new task", writer); break; case STATE_GESTURE_COMPLETED: errorDetected |= printErrorIfTrue( !encounteredEvents.contains(GestureEvent.MOTION_UP), Loading Loading @@ -289,6 +298,21 @@ public class ActiveGestureErrorDetector { + "the task screenshot wasn't cleaned up.", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains( GestureEvent.SET_END_TARGET_LAST_TASK) && !encounteredEvents.contains(GestureEvent.TASK_APPEARED), /* errorMessage= */ prefix + "\t\tend target set to last task, but " + "onTaskAppeared wasn't called.", writer); errorDetected |= printErrorIfTrue( /* condition= */ encounteredEvents.contains( GestureEvent.SET_END_TARGET_NEW_TASK) && !encounteredEvents.contains(GestureEvent.TASK_APPEARED), /* errorMessage= */ prefix + "\t\tend target set to new task, but " + "onTaskAppeared wasn't called.", writer); if (!errorDetected) { writer.println(prefix + "\t\tNo errors detected."); } Loading