Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84ffc17e authored by Yuhan Yang's avatar Yuhan Yang
Browse files

Fix flaky onMotionEvent_initClickSchedulerDelayFromSetting

Bug: 407188511
Test: atest AutoclickController
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: If83c9fb86f85661873fc2b02e6a8f03d5c6bea24
parent 0cb720c4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -83,13 +83,13 @@ import com.android.server.accessibility.Flags;
 */
public class AutoclickController extends BaseEventStreamTransformation {

    public static final int DEFAULT_AUTOCLICK_DELAY_TIME = Flags.enableAutoclickIndicator()
            ? AUTOCLICK_DELAY_WITH_INDICATOR_DEFAULT : AUTOCLICK_DELAY_DEFAULT;

    private static final String LOG_TAG = AutoclickController.class.getSimpleName();
    // TODO(b/393559560): Finalize scroll amount.
    private static final float SCROLL_AMOUNT = 1.0f;

    private static final int DEFAULT_AUTOCLICK_DELAY_TIME = Flags.enableAutoclickIndicator()
            ? AUTOCLICK_DELAY_WITH_INDICATOR_DEFAULT : AUTOCLICK_DELAY_DEFAULT;

    private final AccessibilityTraceManager mTrace;
    private final Context mContext;
    private final int mUserId;
+1 −1
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ public class AutoclickControllerTest {
                Settings.Secure.getIntForUser(
                        mTestableContext.getContentResolver(),
                        Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
                        AccessibilityManager.AUTOCLICK_DELAY_WITH_INDICATOR_DEFAULT,
                        mController.DEFAULT_AUTOCLICK_DELAY_TIME,
                        mTestableContext.getUserId());
        assertThat(mController.mClickScheduler.getDelayForTesting()).isEqualTo(delay);
    }