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

Commit 9faa9374 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Changing the interaction model of the touch explorer." into jb-dev

parents 1ed07417 e15ccb93
Loading
Loading
Loading
Loading
+1 −22
Original line number Diff line number Diff line
@@ -192,20 +192,13 @@ public class ViewConfiguration {
     */
    private static final int MAXIMUM_FLING_VELOCITY = 8000;

    /**
     * Distance in dips between a touch up event denoting the end of a touch exploration
     * gesture and the touch up event of a subsequent tap for the latter tap to be
     * considered as a tap i.e. to perform a click.
     */
    private static final int TOUCH_EXPLORE_TAP_SLOP = 80;

    /**
     * Delay before dispatching a recurring accessibility event in milliseconds.
     * This delay guarantees that a recurring event will be send at most once
     * during the {@link #SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS} time
     * frame.
     */
    private static final long SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS = 400;
    private static final long SEND_RECURRING_ACCESSIBILITY_EVENTS_INTERVAL_MILLIS = 100;

    /**
     * The maximum size of View's drawing cache, expressed in bytes. This size
@@ -238,7 +231,6 @@ public class ViewConfiguration {
    private final int mDoubleTapTouchSlop;
    private final int mPagingTouchSlop;
    private final int mDoubleTapSlop;
    private final int mScaledTouchExploreTapSlop;
    private final int mWindowTouchSlop;
    private final int mMaximumDrawingCacheSize;
    private final int mOverscrollDistance;
@@ -265,7 +257,6 @@ public class ViewConfiguration {
        mDoubleTapTouchSlop = DOUBLE_TAP_TOUCH_SLOP;
        mPagingTouchSlop = PAGING_TOUCH_SLOP;
        mDoubleTapSlop = DOUBLE_TAP_SLOP;
        mScaledTouchExploreTapSlop = TOUCH_EXPLORE_TAP_SLOP;
        mWindowTouchSlop = WINDOW_TOUCH_SLOP;
        //noinspection deprecation
        mMaximumDrawingCacheSize = MAXIMUM_DRAWING_CACHE_SIZE;
@@ -302,7 +293,6 @@ public class ViewConfiguration {
        mMaximumFlingVelocity = (int) (density * MAXIMUM_FLING_VELOCITY + 0.5f);
        mScrollbarSize = (int) (density * SCROLL_BAR_SIZE + 0.5f);
        mDoubleTapSlop = (int) (sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f);
        mScaledTouchExploreTapSlop = (int) (density * TOUCH_EXPLORE_TAP_SLOP + 0.5f);
        mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f);

        final Display display = WindowManagerImpl.getDefault().getDefaultDisplay();
@@ -552,17 +542,6 @@ public class ViewConfiguration {
        return mDoubleTapSlop;
    }

    /**
     * @return Distance in pixels between a touch up event denoting the end of a touch exploration
     * gesture and the touch up event of a subsequent tap for the latter tap to be
     * considered as a tap i.e. to perform a click.
     *
     * @hide
     */
    public int getScaledTouchExploreTapSlop() {
        return mScaledTouchExploreTapSlop;
    }

    /**
     * Interval for dispatching a recurring accessibility event in milliseconds.
     * This interval guarantees that a recurring event will be send at most once
−28.9 KiB (8.56 KiB)

File changed.

No diff preview for this file type.

+2 −0
Original line number Diff line number Diff line
@@ -1518,6 +1518,8 @@
  <java-symbol type="xml" name="storage_list" />
  <java-symbol type="bool" name="config_enableDreams" />
  <java-symbol type="string" name="config_defaultDreamComponent" />
  <java-symbol type="string" name="enable_explore_by_touch_warning_title" />
  <java-symbol type="string" name="enable_explore_by_touch_warning_message" />

  <java-symbol type="layout" name="resolver_grid" />
  <java-symbol type="id" name="resolver_grid" />
+19 −0
Original line number Diff line number Diff line
@@ -2503,6 +2503,25 @@
    <!-- SearchView accessibility description for voice button [CHAR LIMIT=NONE] -->
    <string name="searchview_description_voice">Voice search</string>

    <!-- Title for a warning message about the interaction model changes after allowing an accessibility
         service to put the device into explore by touch mode, displayed as a dialog message when
         the user selects to enables the service. (default). [CHAR LIMIT=35] -->
    <string name="enable_explore_by_touch_warning_title">Enable Explore by Touch?</string>
    <!-- Summary for a warning message about the interaction model changes after allowing an accessibility
         service to put the device into explore by touch mode, displayed as a dialog message when
         the user selects to enables the service. (tablet). [CHAR LIMIT=NONE] -->
    <string name="enable_explore_by_touch_warning_message" product="tablet">
            <xliff:g id="accessibility_service_name">%1$s</xliff:g> wants to enable Explore by Touch.
            When Explore by Touch is turned on, you can hear or see descriptions of what\'s under
            your finger or perform gestures to interact with the tablet.</string>
    <!-- Summary for a warning message about the interaction model changes after allowing an accessibility
         service to put the device into explore by touch mode, displayed as a dialog message when
         the user selects to enables the service. (default). [CHAR LIMIT=NONE] -->
    <string name="enable_explore_by_touch_warning_message" product="default">
            <xliff:g id="accessibility_service_name">%1$s</xliff:g> wants to enable Explore by Touch.
            When Explore by Touch is turned on, you can hear or see descriptions of what\'s under
            your finger or perform gestures to interact with the phone.</string>

    <!-- String used to display the date. This is the string to say something happened 1 month ago. -->
    <string name="oneMonthDurationPast">1 month ago</string>
    <!-- String used to display the date. This is the string to say something happened more than 1 month ago. -->
+4 −5
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.server.accessibility;

import com.android.server.accessibility.TouchExplorer.GestureListener;
import com.android.server.input.InputFilter;

import android.content.Context;
@@ -40,7 +39,7 @@ public class AccessibilityInputFilter extends InputFilter {

    private final PowerManager mPm;

    private final GestureListener mGestureListener;
    private final AccessibilityManagerService mAms;

    /**
     * This is an interface for explorers that take a {@link MotionEvent}
@@ -73,10 +72,10 @@ public class AccessibilityInputFilter extends InputFilter {

    private int mTouchscreenSourceDeviceId;

    public AccessibilityInputFilter(Context context, GestureListener gestureListener) {
    public AccessibilityInputFilter(Context context, AccessibilityManagerService service) {
        super(context.getMainLooper());
        mContext = context;
        mGestureListener = gestureListener;
        mAms = service;
        mPm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
    }

@@ -85,7 +84,7 @@ public class AccessibilityInputFilter extends InputFilter {
        if (DEBUG) {
            Slog.d(TAG, "Accessibility input filter installed.");
        }
        mTouchExplorer = new TouchExplorer(this, mContext, mGestureListener);
        mTouchExplorer = new TouchExplorer(this, mContext, mAms);
        super.onInstalled();
    }

Loading