summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2011-08-05 06:23:22 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2011-08-05 07:54:50 -0700
commit3e4e4af45216aee4d4b009fe842c0324610918eb (patch)
tree79cdb68b22a2b76b6ad5ba7d7db28ee67d33a8f1 /services
parent9fbceea01da9d802f2f03b559f78989d2ae50881 (diff)
downloadframeworks_base-3e4e4af45216aee4d4b009fe842c0324610918eb.zip
frameworks_base-3e4e4af45216aee4d4b009fe842c0324610918eb.tar.gz
frameworks_base-3e4e4af45216aee4d4b009fe842c0324610918eb.tar.bz2
Turning off accessibility feature reboots the device
1. The touch explorer uses delayed injection of events which can happen after its hosting accessibility input filer has been unregistered, thus the explorer was trying to inject events when this is not allowed. Now upon unregistration of the accessibility explorer it resets the state of the touch explorer it hosts. bug:5105956 Change-Id: I720682abf93382aedf4f431eaac90fd2c781e442
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/accessibility/AccessibilityInputFilter.java13
-rw-r--r--services/java/com/android/server/accessibility/TouchExplorer.java3
2 files changed, 10 insertions, 6 deletions
diff --git a/services/java/com/android/server/accessibility/AccessibilityInputFilter.java b/services/java/com/android/server/accessibility/AccessibilityInputFilter.java
index 8ba0a0b..769cb6a 100644
--- a/services/java/com/android/server/accessibility/AccessibilityInputFilter.java
+++ b/services/java/com/android/server/accessibility/AccessibilityInputFilter.java
@@ -56,6 +56,11 @@ public class AccessibilityInputFilter extends InputFilter {
* @param policyFlags The policy flags associated with the event.
*/
public void clear(MotionEvent event, int policyFlags);
+
+ /**
+ * Requests that the explorer clears its internal state.
+ */
+ public void clear();
}
private TouchExplorer mTouchExplorer;
@@ -71,6 +76,7 @@ public class AccessibilityInputFilter extends InputFilter {
if (DEBUG) {
Slog.d(TAG, "Accessibility input filter installed.");
}
+ mTouchExplorer = new TouchExplorer(this, mContext);
super.onInstalled();
}
@@ -79,6 +85,7 @@ public class AccessibilityInputFilter extends InputFilter {
if (DEBUG) {
Slog.d(TAG, "Accessibility input filter uninstalled.");
}
+ mTouchExplorer.clear();
super.onUninstalled();
}
@@ -93,11 +100,7 @@ public class AccessibilityInputFilter extends InputFilter {
int deviceId = event.getDeviceId();
if (mTouchscreenSourceDeviceId != deviceId) {
mTouchscreenSourceDeviceId = deviceId;
- if (mTouchExplorer != null) {
- mTouchExplorer.clear(motionEvent, policyFlags);
- } else {
- mTouchExplorer = new TouchExplorer(this, mContext);
- }
+ mTouchExplorer.clear(motionEvent, policyFlags);
}
if ((policyFlags & WindowManagerPolicy.FLAG_PASS_TO_USER) != 0) {
mTouchExplorer.onMotionEvent(motionEvent, policyFlags);
diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java
index 0808d5d..4ad2916 100644
--- a/services/java/com/android/server/accessibility/TouchExplorer.java
+++ b/services/java/com/android/server/accessibility/TouchExplorer.java
@@ -858,8 +858,9 @@ public class TouchExplorer implements Explorer {
/**
* Clears the internal state of this explorer.
*/
- private void clear() {
+ public void clear() {
mSendHoverDelayed.remove();
+ mPerformLongPressDelayed.remove();
mPointerTracker.clear();
mLastTouchExploreEvent = null;
mCurrentState = STATE_TOUCH_EXPLORING;