Changing the interaction model of the touch explorer.
1. Now the user have to double tap to activate the last
item. If the last touched window is not active because
it does not take input focus the click on the last
touch explored location. Othewise the click is on the
accessibility focus location.
bug:5932640
Change-Id: Ibb7b97262a7c5f2f94abef429e02790fdc91a8dd
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 9134966..823befb 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -193,19 +193,12 @@
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 @@
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 @@
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 @@
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();
@@ -553,17 +543,6 @@
}
/**
- * @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
* during the {@link #getSendRecurringAccessibilityEventsInterval()} time frame.
diff --git a/core/res/res/raw/accessibility_gestures.bin b/core/res/res/raw/accessibility_gestures.bin
index 96fa1ec..acd7993 100644
--- a/core/res/res/raw/accessibility_gestures.bin
+++ b/core/res/res/raw/accessibility_gestures.bin
Binary files differ
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index a24e345c..6cab524 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1513,6 +1513,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" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 4511201..a318b2459 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -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. -->