Loading quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java +16 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ public class ActiveGestureErrorDetector { private ActiveGestureErrorDetector() {} private static final long ON_START_RECENT_ANIMATION_TIME_LIMIT = 500; protected static void analyseAndDump( @NonNull String prefix, @NonNull PrintWriter writer, Loading @@ -76,6 +78,7 @@ public class ActiveGestureErrorDetector { // Use a Set since the order is inherently checked in the loop. final Set<GestureEvent> encounteredEvents = new ArraySet<>(); // Set flags and check order of operations. long lastStartRecentAnimationEventEntryTime = 0; for (ActiveGestureLog.EventEntry eventEntry : eventLog.eventEntries) { GestureEvent gestureEvent = eventEntry.getGestureEvent(); if (gestureEvent == null) { Loading Loading @@ -234,6 +237,16 @@ public class ActiveGestureErrorDetector { /* errorMessage= */ "ON_START_RECENTS_ANIMATION " + "onAnimationStart callback ran before startRecentsAnimation", writer); errorDetected |= printErrorIfTrue( eventEntry.getTime() - lastStartRecentAnimationEventEntryTime > ON_START_RECENT_ANIMATION_TIME_LIMIT, prefix, /* errorMessage= */"ON_START_RECENTS_ANIMATION " + "startRecentsAnimation was never called or onAnimationStart " + "callback was called more than 500 ms after " + "startRecentsAnimation.", writer); lastStartRecentAnimationEventEntryTime = 0; break; case ON_CANCEL_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( Loading @@ -253,12 +266,14 @@ public class ActiveGestureErrorDetector { + "callback", writer); break; case START_RECENTS_ANIMATION: lastStartRecentAnimationEventEntryTime = eventEntry.getTime(); break; case MOTION_DOWN: case SET_END_TARGET: case SET_END_TARGET_HOME: case SET_END_TARGET_ALL_APPS: case SET_END_TARGET_NEW_TASK: case START_RECENTS_ANIMATION: case SET_ON_PAGE_TRANSITION_END_CALLBACK: case CANCEL_CURRENT_ANIMATION: case FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER: Loading quickstep/src/com/android/quickstep/util/ActiveGestureLog.java +4 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ public class ActiveGestureLog { time = System.currentTimeMillis(); duplicateCount = 0; } public long getTime() { return time; } } /** An entire log of entries associated with a single log ID */ Loading Loading
quickstep/src/com/android/quickstep/util/ActiveGestureErrorDetector.java +16 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ public class ActiveGestureErrorDetector { private ActiveGestureErrorDetector() {} private static final long ON_START_RECENT_ANIMATION_TIME_LIMIT = 500; protected static void analyseAndDump( @NonNull String prefix, @NonNull PrintWriter writer, Loading @@ -76,6 +78,7 @@ public class ActiveGestureErrorDetector { // Use a Set since the order is inherently checked in the loop. final Set<GestureEvent> encounteredEvents = new ArraySet<>(); // Set flags and check order of operations. long lastStartRecentAnimationEventEntryTime = 0; for (ActiveGestureLog.EventEntry eventEntry : eventLog.eventEntries) { GestureEvent gestureEvent = eventEntry.getGestureEvent(); if (gestureEvent == null) { Loading Loading @@ -234,6 +237,16 @@ public class ActiveGestureErrorDetector { /* errorMessage= */ "ON_START_RECENTS_ANIMATION " + "onAnimationStart callback ran before startRecentsAnimation", writer); errorDetected |= printErrorIfTrue( eventEntry.getTime() - lastStartRecentAnimationEventEntryTime > ON_START_RECENT_ANIMATION_TIME_LIMIT, prefix, /* errorMessage= */"ON_START_RECENTS_ANIMATION " + "startRecentsAnimation was never called or onAnimationStart " + "callback was called more than 500 ms after " + "startRecentsAnimation.", writer); lastStartRecentAnimationEventEntryTime = 0; break; case ON_CANCEL_RECENTS_ANIMATION: errorDetected |= printErrorIfTrue( Loading @@ -253,12 +266,14 @@ public class ActiveGestureErrorDetector { + "callback", writer); break; case START_RECENTS_ANIMATION: lastStartRecentAnimationEventEntryTime = eventEntry.getTime(); break; case MOTION_DOWN: case SET_END_TARGET: case SET_END_TARGET_HOME: case SET_END_TARGET_ALL_APPS: case SET_END_TARGET_NEW_TASK: case START_RECENTS_ANIMATION: case SET_ON_PAGE_TRANSITION_END_CALLBACK: case CANCEL_CURRENT_ANIMATION: case FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER: Loading
quickstep/src/com/android/quickstep/util/ActiveGestureLog.java +4 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ public class ActiveGestureLog { time = System.currentTimeMillis(); duplicateCount = 0; } public long getTime() { return time; } } /** An entire log of entries associated with a single log ID */ Loading