mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Merge "Wait for dismiss animation to finish before checking task count" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b0ef69e886
@@ -2599,6 +2599,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
|
||||
protected void onDismissAnimationEnds() {
|
||||
AccessibilityManagerCompat.sendDismissAnimationEndsEventToTest(getContext());
|
||||
}
|
||||
|
||||
public PendingAnimation createAllTasksDismissAnimation(long duration) {
|
||||
|
||||
@@ -87,7 +87,14 @@ public class AccessibilityManagerCompat {
|
||||
if (accessibilityManager == null) return;
|
||||
|
||||
sendEventToTest(accessibilityManager, context, TestProtocol.PAUSE_DETECTED_MESSAGE, null);
|
||||
Log.d(TestProtocol.HOME_TO_OVERVIEW_FLAKY, "sendPauseDetectedEventToTest");
|
||||
}
|
||||
|
||||
public static void sendDismissAnimationEndsEventToTest(Context context) {
|
||||
final AccessibilityManager accessibilityManager = getAccessibilityManagerForTest(context);
|
||||
if (accessibilityManager == null) return;
|
||||
|
||||
sendEventToTest(accessibilityManager, context, TestProtocol.DISMISS_ANIMATION_ENDS_MESSAGE,
|
||||
null);
|
||||
}
|
||||
|
||||
private static void sendEventToTest(
|
||||
|
||||
@@ -24,6 +24,7 @@ public final class TestProtocol {
|
||||
public static final String SWITCHED_TO_STATE_MESSAGE = "TAPL_SWITCHED_TO_STATE";
|
||||
public static final String SCROLL_FINISHED_MESSAGE = "TAPL_SCROLL_FINISHED";
|
||||
public static final String PAUSE_DETECTED_MESSAGE = "TAPL_PAUSE_DETECTED";
|
||||
public static final String DISMISS_ANIMATION_ENDS_MESSAGE = "TAPL_DISMISS_ANIMATION_ENDS";
|
||||
public static final int NORMAL_STATE_ORDINAL = 0;
|
||||
public static final int SPRING_LOADED_STATE_ORDINAL = 1;
|
||||
public static final int OVERVIEW_STATE_ORDINAL = 2;
|
||||
@@ -111,5 +112,4 @@ public final class TestProtocol {
|
||||
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
|
||||
public static final String WORK_PROFILE_REMOVED = "b/159671700";
|
||||
public static final String FALLBACK_ACTIVITY_NO_SET = "b/181019015";
|
||||
public static final String HOME_TO_OVERVIEW_FLAKY = "b/193440212";
|
||||
}
|
||||
|
||||
@@ -59,9 +59,14 @@ public final class OverviewTask {
|
||||
final Rect taskBounds = mLauncher.getVisibleBounds(mTask);
|
||||
final int centerX = taskBounds.centerX();
|
||||
final int centerY = taskBounds.centerY();
|
||||
mLauncher.linearGesture(centerX, centerY, centerX, 0, 10, false,
|
||||
LauncherInstrumentation.GestureScope.INSIDE);
|
||||
mLauncher.waitForIdle();
|
||||
mLauncher.executeAndWaitForLauncherEvent(
|
||||
() -> mLauncher.linearGesture(centerX, centerY, centerX, 0, 10, false,
|
||||
LauncherInstrumentation.GestureScope.INSIDE),
|
||||
event -> TestProtocol.DISMISS_ANIMATION_ENDS_MESSAGE.equals(
|
||||
event.getClassName()),
|
||||
() -> "Didn't receive a dismiss animation ends message: " + centerX + ", "
|
||||
+ centerY,
|
||||
"swiping to dismiss");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user