diff options
7 files changed, 4 insertions, 167 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java index 487703bb73b2..75724bffabf8 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java @@ -38,7 +38,6 @@ import android.view.MotionEvent; import android.view.accessibility.AccessibilityEvent; import com.android.server.LocalServices; -import com.android.server.accessibility.cursor.SoftwareCursorGestureHandler; import com.android.server.accessibility.gestures.TouchExplorer; import com.android.server.accessibility.magnification.FullScreenMagnificationGestureHandler; import com.android.server.accessibility.magnification.MagnificationGestureHandler; @@ -142,13 +141,6 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo */ static final int FLAG_SEND_MOTION_EVENTS = 0x00000400; - /** - * Flag for enabling the Software Cursor accessibility feature. - * - * @see setUserAndEnabledFeatures(int, int) - */ - static final int FLAG_FEATURE_SOFTWARE_CURSOR = 0x00000800; - static final int FEATURES_AFFECTING_MOTION_EVENTS = FLAG_FEATURE_INJECT_MOTION_EVENTS | FLAG_FEATURE_AUTOCLICK @@ -157,8 +149,7 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo | FLAG_FEATURE_TRIGGERED_SCREEN_MAGNIFIER | FLAG_SERVICE_HANDLES_DOUBLE_TAP | FLAG_REQUEST_MULTI_FINGER_GESTURES - | FLAG_REQUEST_2_FINGER_PASSTHROUGH - | FLAG_FEATURE_SOFTWARE_CURSOR; + | FLAG_REQUEST_2_FINGER_PASSTHROUGH; private final Context mContext; @@ -179,9 +170,6 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo private KeyboardInterceptor mKeyboardInterceptor; - private SparseArray<SoftwareCursorGestureHandler> mSoftwareCursorGestureHandler = - new SparseArray<>(0); - private boolean mInstalled; private int mUserId; @@ -507,16 +495,6 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo mMagnificationGestureHandler.put(displayId, magnificationGestureHandler); } - if ((mEnabledFeatures & FLAG_FEATURE_SOFTWARE_CURSOR) != 0) { - // TODO: Add full support for multiple displays. - final SoftwareCursorGestureHandler softwareCursorGestureHandler = - new SoftwareCursorGestureHandler(displayContext, - mAms.getSoftwareCursorManager(), - mAms.getTraceManager()); - addFirstEventHandler(displayId, softwareCursorGestureHandler); - mSoftwareCursorGestureHandler.put(displayId, softwareCursorGestureHandler); - } - if ((mEnabledFeatures & FLAG_FEATURE_INJECT_MOTION_EVENTS) != 0) { MotionEventInjector injector = new MotionEventInjector( mContext.getMainLooper(), mAms.getTraceManager()); @@ -587,20 +565,12 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo mTouchExplorer.remove(displayId); } - final MagnificationGestureHandler handler = - mMagnificationGestureHandler.get(displayId); + final MagnificationGestureHandler handler = mMagnificationGestureHandler.get(displayId); if (handler != null) { handler.onDestroy(); mMagnificationGestureHandler.remove(displayId); } - final SoftwareCursorGestureHandler softwareCursorHandler = - mSoftwareCursorGestureHandler.get(displayId); - if (softwareCursorHandler != null) { - softwareCursorHandler.onDestroy(); - mSoftwareCursorGestureHandler.remove(displayId); - } - final EventStreamTransformation eventStreamTransformation = mEventHandler.get(displayId); if (eventStreamTransformation != null) { mEventHandler.remove(displayId); diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index 482947098cdb..1efbb0a3c171 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -140,7 +140,6 @@ import com.android.internal.util.IntPair; import com.android.server.AccessibilityManagerInternal; import com.android.server.LocalServices; import com.android.server.SystemService; -import com.android.server.accessibility.cursor.SoftwareCursorManager; import com.android.server.accessibility.magnification.MagnificationController; import com.android.server.accessibility.magnification.MagnificationProcessor; import com.android.server.accessibility.magnification.MagnificationScaleProvider; @@ -245,8 +244,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub private final MagnificationController mMagnificationController; private final MagnificationProcessor mMagnificationProcessor; - private final SoftwareCursorManager mSoftwareCursorManager; - private final MainHandler mMainHandler; // Lazily initialized - access through getSystemActionPerformer() @@ -415,7 +412,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub mMagnificationController = magnificationController; mMagnificationProcessor = new MagnificationProcessor(mMagnificationController); mCaptioningManagerImpl = new CaptioningManagerImpl(mContext); - mSoftwareCursorManager = new SoftwareCursorManager(); if (inputFilter != null) { mInputFilter = inputFilter; mHasInputFilter = true; @@ -449,7 +445,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub new MagnificationScaleProvider(mContext)); mMagnificationProcessor = new MagnificationProcessor(mMagnificationController); mCaptioningManagerImpl = new CaptioningManagerImpl(mContext); - mSoftwareCursorManager = new SoftwareCursorManager(); init(); } @@ -2287,9 +2282,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub if (userState.isPerformGesturesEnabledLocked()) { flags |= AccessibilityInputFilter.FLAG_FEATURE_INJECT_MOTION_EVENTS; } - if (userState.isSoftwareCursorEnabledLocked()) { - flags |= AccessibilityInputFilter.FLAG_FEATURE_SOFTWARE_CURSOR; - } if (flags != 0) { if (!mHasInputFilter) { mHasInputFilter = true; @@ -3491,15 +3483,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub return mMagnificationController; } - /** - * Getter of {@link SoftwareCursorManager}. - * - * @return SoftwareCursorManager - */ - SoftwareCursorManager getSoftwareCursorManager() { - return mSoftwareCursorManager; - } - @Override public void associateEmbeddedHierarchy(@NonNull IBinder host, @NonNull IBinder embedded) { if (mTraceManager.isA11yTracingEnabledForTypes(FLAGS_ACCESSIBILITY_MANAGER)) { diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java index 5366a45b3ad0..55dc196fc18d 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java @@ -109,7 +109,6 @@ class AccessibilityUserState { private boolean mIsAudioDescriptionByDefaultRequested; private boolean mIsAutoclickEnabled; private boolean mIsDisplayMagnificationEnabled; - private boolean mIsSoftwareCursorEnabled; private boolean mIsFilterKeyEventsEnabled; private boolean mIsPerformGesturesEnabled; private boolean mAccessibilityFocusOnlyInActiveWindow; @@ -209,7 +208,6 @@ class AccessibilityUserState { mRequestTwoFingerPassthrough = false; mSendMotionEventsEnabled = false; mIsDisplayMagnificationEnabled = false; - mIsSoftwareCursorEnabled = false; mIsAutoclickEnabled = false; mUserNonInteractiveUiTimeout = 0; mUserInteractiveUiTimeout = 0; @@ -511,8 +509,6 @@ class AccessibilityUserState { pw.append(", sendMotionEventsEnabled").append(String.valueOf(mSendMotionEventsEnabled)); pw.append(", displayMagnificationEnabled=").append(String.valueOf( mIsDisplayMagnificationEnabled)); - pw.append(", softwareCursorEnabled=").append(String.valueOf( - mIsSoftwareCursorEnabled)); pw.append(", autoclickEnabled=").append(String.valueOf(mIsAutoclickEnabled)); pw.append(", nonInteractiveUiTimeout=").append(String.valueOf(mNonInteractiveUiTimeout)); pw.append(", interactiveUiTimeout=").append(String.valueOf(mInteractiveUiTimeout)); @@ -623,14 +619,6 @@ class AccessibilityUserState { mIsDisplayMagnificationEnabled = enabled; } - public boolean isSoftwareCursorEnabledLocked() { - return mIsSoftwareCursorEnabled; - } - - public void setSoftwareCursorEnabledLocked(boolean enabled) { - mIsSoftwareCursorEnabled = enabled; - } - public boolean isFilterKeyEventsEnabledLocked() { return mIsFilterKeyEventsEnabled; } diff --git a/services/accessibility/java/com/android/server/accessibility/cursor/SoftwareCursorGestureHandler.java b/services/accessibility/java/com/android/server/accessibility/cursor/SoftwareCursorGestureHandler.java deleted file mode 100644 index 6ffa8f723257..000000000000 --- a/services/accessibility/java/com/android/server/accessibility/cursor/SoftwareCursorGestureHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.server.accessibility.cursor; - -import android.content.Context; -import android.util.Log; -import android.util.Slog; -import android.view.MotionEvent; - -import com.android.server.accessibility.AccessibilityTraceManager; -import com.android.server.accessibility.BaseEventStreamTransformation; - -/** - * Handles touch input for the Software Cursor accessibility feature. - * - * The behavior is as follows: - * - * <ol> - * <li> 1. Enable Software Cursor by swiping from the trigger zone on the edge of the screen. - * <li> 2. Move the cursor by swiping anywhere on the touch screen. Select by tapping anywhere on - * the touch screen. - * <li> 3. Put the cursor away by swiping it past either edge of the screen. - * </ol> - * - * TODO(b/243552818): Determine how to handle multi-display. - */ -public final class SoftwareCursorGestureHandler extends BaseEventStreamTransformation { - - - private static final String LOG_TAG = "SWCursorGestureHandler"; - private static final boolean DEBUG_ALL = Log.isLoggable("SWCursorGestureHandler", - Log.DEBUG); - - Context mContext; - SoftwareCursorManager mSoftwareCursorManager; - AccessibilityTraceManager mTraceManager; - - public SoftwareCursorGestureHandler(Context context, - SoftwareCursorManager softwareCursorManager, - AccessibilityTraceManager traceManager) { - mContext = context; - mSoftwareCursorManager = softwareCursorManager; - mTraceManager = traceManager; - } - - @Override - public void onMotionEvent(MotionEvent event, MotionEvent rawEvent, int policyFlags) { - if (DEBUG_ALL) { - Slog.i(LOG_TAG, "onMotionEvent(" + event + ")"); - } - // TODO: Add logic. - // TODO: Prevent users from enabling this filter in conjuntion with TouchExplorer. - super.onMotionEvent(event, rawEvent, policyFlags); - } - - -} diff --git a/services/accessibility/java/com/android/server/accessibility/cursor/SoftwareCursorManager.java b/services/accessibility/java/com/android/server/accessibility/cursor/SoftwareCursorManager.java deleted file mode 100644 index 9b370d87e386..000000000000 --- a/services/accessibility/java/com/android/server/accessibility/cursor/SoftwareCursorManager.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.server.accessibility.cursor; - -/** - * Allows the Software Cursor feature to interface with its corresponding code in the SystemUI - * process. - */ -public final class SoftwareCursorManager { - - public SoftwareCursorManager() { - // TODO: Add behavior in a future CL. - } -} diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityInputFilterTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityInputFilterTest.java index e165f063e2fa..464fee2bfc11 100644 --- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityInputFilterTest.java +++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityInputFilterTest.java @@ -24,7 +24,6 @@ import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEA import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_CONTROL_SCREEN_MAGNIFIER; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_FILTER_KEY_EVENTS; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_INJECT_MOTION_EVENTS; -import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_SOFTWARE_CURSOR; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_TOUCH_EXPLORATION; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_TRIGGERED_SCREEN_MAGNIFIER; @@ -53,7 +52,6 @@ import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.android.server.LocalServices; -import com.android.server.accessibility.cursor.SoftwareCursorGestureHandler; import com.android.server.accessibility.gestures.TouchExplorer; import com.android.server.accessibility.magnification.FullScreenMagnificationGestureHandler; import com.android.server.accessibility.magnification.MagnificationGestureHandler; @@ -85,7 +83,6 @@ public class AccessibilityInputFilterTest { private final ArrayList<Display> mDisplayList = new ArrayList<>(); private final int mFeatures = FLAG_FEATURE_AUTOCLICK | FLAG_FEATURE_TOUCH_EXPLORATION - | FLAG_FEATURE_SOFTWARE_CURSOR | FLAG_FEATURE_CONTROL_SCREEN_MAGNIFIER | FLAG_FEATURE_TRIGGERED_SCREEN_MAGNIFIER | FLAG_FEATURE_INJECT_MOTION_EVENTS @@ -94,8 +91,8 @@ public class AccessibilityInputFilterTest { // The expected order of EventStreamTransformations. private final Class[] mExpectedEventHandlerTypes = {KeyboardInterceptor.class, MotionEventInjector.class, - SoftwareCursorGestureHandler.class, FullScreenMagnificationGestureHandler.class, - TouchExplorer.class, AutoclickController.class, AccessibilityInputFilter.class}; + FullScreenMagnificationGestureHandler.class, TouchExplorer.class, + AutoclickController.class, AccessibilityInputFilter.class}; @Mock private WindowManagerInternal.AccessibilityControllerInternal mMockA11yController; @Mock private WindowManagerInternal mMockWindowManagerService; diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java index 9475d0f0c0aa..ed0336a5a4ea 100644 --- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java +++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityUserStateTest.java @@ -149,7 +149,6 @@ public class AccessibilityUserStateTest { mUserState.setTargetAssignedToAccessibilityButton(COMPONENT_NAME.flattenToString()); mUserState.setTouchExplorationEnabledLocked(true); mUserState.setDisplayMagnificationEnabledLocked(true); - mUserState.setSoftwareCursorEnabledLocked(true); mUserState.setAutoclickEnabledLocked(true); mUserState.setUserNonInteractiveUiTimeoutLocked(30); mUserState.setUserInteractiveUiTimeoutLocked(30); @@ -172,7 +171,6 @@ public class AccessibilityUserStateTest { assertNull(mUserState.getTargetAssignedToAccessibilityButton()); assertFalse(mUserState.isTouchExplorationEnabledLocked()); assertFalse(mUserState.isDisplayMagnificationEnabledLocked()); - assertFalse(mUserState.isSoftwareCursorEnabledLocked()); assertFalse(mUserState.isAutoclickEnabledLocked()); assertEquals(0, mUserState.getUserNonInteractiveUiTimeoutLocked()); assertEquals(0, mUserState.getUserInteractiveUiTimeoutLocked()); |