car/src/main/java/androidx/car/moderator/SpeedBumpController.java
boolean onTouchEvent(MotionEvent ev) {
        int action = ev.getActionMasked();

        // Check if the user has just finished an MotionEvent and count that as an action. Check
        // the ContentRateLimiter to see if interaction is currently permitted.
        if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
            boolean nextActionPermitted = mContentRateLimiter.tryAcquire();

            // Indicates that this is the first action that is not permitted. In this case, the
            // child view should at least handle the ACTION_CANCEL or ACTION_UP, so call
            // super.dispatchTouchEvent(), but lock out further interaction.
            if (mInteractionPermitted && !nextActionPermitted) {
                mInteractionPermitted = false;
                showLockOutMessage();
                return true;
            }
        }

        // Otherwise, return if interaction is permitted.
        return mInteractionPermitted;
    }
/**
     * Notifies this {@code SpeedBumpController} that the given {@link MotionEvent} has occurred.
     * This method will return whether or not further interaction should be allowed.
     *
     * @param ev The {@link MotionEvent} that represents a touch event.
     * @return {@code true} if the touch event should be allowed.
     */
Notifies this  SpeedBumpController that the given  MotionEvent has occurred.
This method will return whether or not further interaction should be allowed.

@param ev The  MotionEvent that represents a touch event.
@return  true if the touch event should be allowed.
Notifies this SpeedBumpController that the given MotionEvent has occurred . This method will return whether or not further interaction should be allowed . @param ev The MotionEvent that represents a touch event . @return true if the touch event should be allowed .
boolean onTouchEvent(MotionEvent ev) {
        int action = ev.getActionMasked();
        if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
            boolean nextActionPermitted = mContentRateLimiter.tryAcquire();
            if (mInteractionPermitted && !nextActionPermitted) {
                mInteractionPermitted = false;
                showLockOutMessage();
                return true;
            }
        }
        return mInteractionPermitted;
    }
boolean onTouchEvent ( MotionEvent ev ) { int action = ev . getActionMasked ( ) ; if ( action == MotionEvent . ACTION_CANCEL || action == MotionEvent . ACTION_UP ) { boolean nextActionPermitted = mContentRateLimiter . tryAcquire ( ) ; if ( mInteractionPermitted && ! nextActionPermitted ) { mInteractionPermitted = false ; showLockOutMessage ( ) ; return true ; } } return mInteractionPermitted ; }
Notifies this {@code SpeedBumpController} that the given {@link MotionEvent} has occurred.
Notifies this { @code SpeedBumpController } that the given { @link MotionEvent } has occurred .
// Check if the user has just finished an MotionEvent and count that as an action. Check // the ContentRateLimiter to see if interaction is currently permitted. // Indicates that this is the first action that is not permitted. In this case, the // child view should at least handle the ACTION_CANCEL or ACTION_UP, so call // super.dispatchTouchEvent(), but lock out further interaction. // Otherwise, return if interaction is permitted.