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

Commit fdf02a18 authored by Longbo Wei's avatar Longbo Wei Committed by Android (Google) Code Review
Browse files

Merge "autoclick: Log the state of autoclick settings" into main

parents b0967ece 1d68267d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ public class AutoclickController extends BaseEventStreamTransformation {

    private final AccessibilityTraceManager mTrace;
    private final Context mContext;
    private int mCursorAreaSize;
    private final int mUserId;

    // The position where scroll actually happens.
@@ -348,6 +349,12 @@ public class AutoclickController extends BaseEventStreamTransformation {
            mAutoclickSettingsObserver = null;
        }
        if (mClickScheduler != null) {
            // Log the current autoclick settings state (delay, cursor size etc.)
            AutoclickLogger.logAutoclickSettingsState(
                    mClickScheduler.mDelay,
                    mCursorAreaSize,
                    mClickScheduler.mIgnoreMinorCursorMovement,
                    mClickScheduler.mRevertToLeftClick);
            mClickScheduler.cancel();
            mClickScheduler = null;
        }
@@ -787,7 +794,8 @@ public class AutoclickController extends BaseEventStreamTransformation {

        // Cursor area size corresponds to the ring indicator radius size.
        public void updateCursorAreaSize(int size) {
            mAutoclickIndicatorView.setRadius(size);
            mCursorAreaSize = size;
            mAutoclickIndicatorView.setRadius(mCursorAreaSize);
        }
    }

+22 −0
Original line number Diff line number Diff line
@@ -62,4 +62,26 @@ public class AutoclickLogger {
        FrameworkStatsLog.write(FrameworkStatsLog.AUTOCLICK_SESSION_DURATION_REPORTED,
                sessionDurationSeconds);
    }

    /**
     * Logs the state of autoclick settings.
     *
     * @param delayBeforeClickMs        Delay in milliseconds before autoclick triggers.
     * @param cursorAreaSize            Size  for the autoclick cursor indicator.
     * @param ignoreMinorCursorMovement Whether to ignore small cursor movements.
     * @param revertToLeftClick         Whether to revert to left click after performing autoclick.
     */
    public static void logAutoclickSettingsState(
            long delayBeforeClickMs,
            int cursorAreaSize,
            boolean ignoreMinorCursorMovement,
            boolean revertToLeftClick) {

        FrameworkStatsLog.write(
                FrameworkStatsLog.AUTOCLICK_SETTINGS_STATE_REPORTED,
                delayBeforeClickMs,
                cursorAreaSize,
                ignoreMinorCursorMovement,
                revertToLeftClick);
    }
}