diff options
author | 2025-03-18 12:37:06 -0700 | |
---|---|---|
committer | 2025-03-18 12:37:06 -0700 | |
commit | 9ef1fb8c4e7f8d76b1e3739584933f7df963521e (patch) | |
tree | 6824e58718bfb5f964ff3207c4a337d39ef51184 /services/accessibility | |
parent | 5434639a38250ffd4ca7d239829beeb158dcb4ee (diff) |
cleanup: Roll out flag copy_events_for_gesture_detection by deleting usage
This flag was incorrectly tagged as non-bugfix, but is guarding a bugfix.
The flag has been in Trunkfood Full for 2 months.
Bug: 377736692
Flag: android.view.accessibility.copy_events_for_gesture_detection
Test: (existing presubmit; change is a no-op)
Change-Id: I9ccb09d0c1f0441cf79c4046802df7e3aac58c73
Diffstat (limited to 'services/accessibility')
2 files changed, 12 insertions, 26 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java index 47aa8f5736bf..aae8879e9199 100644 --- a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java +++ b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java @@ -1942,14 +1942,9 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ } public void notifyGesture(AccessibilityGestureEvent gestureEvent) { - if (android.view.accessibility.Flags.copyEventsForGestureDetection()) { - // We will use this event async, so copy it because it contains MotionEvents. - mInvocationHandler.obtainMessage(InvocationHandler.MSG_ON_GESTURE, - gestureEvent.copyForAsync()).sendToTarget(); - } else { - mInvocationHandler.obtainMessage(InvocationHandler.MSG_ON_GESTURE, - gestureEvent).sendToTarget(); - } + // We will use this event async, so copy it because it contains MotionEvents. + mInvocationHandler.obtainMessage(InvocationHandler.MSG_ON_GESTURE, + gestureEvent.copyForAsync()).sendToTarget(); } public void notifySystemActionsChangedLocked() { @@ -2426,9 +2421,7 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ case MSG_ON_GESTURE: { if (message.obj instanceof AccessibilityGestureEvent gesture) { notifyGestureInternal(gesture); - if (android.view.accessibility.Flags.copyEventsForGestureDetection()) { - gesture.recycle(); - } + gesture.recycle(); } } break; case MSG_CLEAR_ACCESSIBILITY_CACHE: { diff --git a/services/accessibility/java/com/android/server/accessibility/gestures/GestureMatcher.java b/services/accessibility/java/com/android/server/accessibility/gestures/GestureMatcher.java index 3668eefe293d..62b6b85afa58 100644 --- a/services/accessibility/java/com/android/server/accessibility/gestures/GestureMatcher.java +++ b/services/accessibility/java/com/android/server/accessibility/gestures/GestureMatcher.java @@ -336,13 +336,8 @@ public abstract class GestureMatcher { // Recycle the old event first if necessary, to handle duplicate calls to post. recycleEvent(); mTargetState = state; - if (android.view.accessibility.Flags.copyEventsForGestureDetection()) { - mEvent = event.copy(); - mRawEvent = rawEvent.copy(); - } else { - mEvent = event; - mRawEvent = rawEvent; - } + mEvent = event.copy(); + mRawEvent = rawEvent.copy(); mPolicyFlags = policyFlags; mHandler.postDelayed(this, delay); if (DEBUG) { @@ -379,15 +374,13 @@ public abstract class GestureMatcher { } private void recycleEvent() { - if (android.view.accessibility.Flags.copyEventsForGestureDetection()) { - if (mEvent == null || mRawEvent == null) { - return; - } - mEvent.recycle(); - mRawEvent.recycle(); - mEvent = null; - mRawEvent = null; + if (mEvent == null || mRawEvent == null) { + return; } + mEvent.recycle(); + mRawEvent.recycle(); + mEvent = null; + mRawEvent = null; } } |