Loading services/accessibility/accessibility.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -155,13 +155,6 @@ flag { bug: "342509709" } flag { name: "enable_magnification_keyboard_control" namespace: "accessibility" description: "Whether to enable keyboard control for magnification" bug: "355487062" } flag { name: "enable_mouse_key_enhancement" namespace: "accessibility" Loading services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java +1 −2 Original line number Diff line number Diff line Loading @@ -820,8 +820,7 @@ public class AccessibilityInputFilter extends InputFilter implements EventStream } } if (Flags.enableMagnificationKeyboardControl() && isAnyMagnificationEnabled(mEnabledFeatures)) { if (isAnyMagnificationEnabled(mEnabledFeatures)) { mMagnificationKeyHandler = new MagnificationKeyHandler( mAms.getMagnificationController()); addFirstEventHandler(Display.DEFAULT_DISPLAY, mMagnificationKeyHandler); Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -5988,7 +5988,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub mNavigationModeUri, false, this, UserHandle.USER_ALL); contentResolver.registerContentObserver( mUserSetupCompleteUri, false, this, UserHandle.USER_ALL); if (isRepeatKeysFeatureFlagEnabled() && Flags.enableMagnificationKeyboardControl()) { if (isRepeatKeysFeatureFlagEnabled()) { contentResolver.registerContentObserver( mRepeatKeysEnabledUri, false, this, UserHandle.USER_ALL); contentResolver.registerContentObserver( Loading Loading @@ -6285,7 +6285,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub } boolean readRepeatKeysSettingsLocked(AccessibilityUserState userState) { if (!isRepeatKeysFeatureFlagEnabled() || !Flags.enableMagnificationKeyboardControl()) { if (!isRepeatKeysFeatureFlagEnabled()) { return false; } final boolean isRepeatKeysEnabled = Settings.Secure.getIntForUser( Loading services/accessibility/java/com/android/server/accessibility/magnification/MagnificationKeyHandler.java +0 −6 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.view.Display; import android.view.KeyEvent; import com.android.server.accessibility.BaseEventStreamTransformation; import com.android.server.accessibility.Flags; /* * A class that listens to key presses used to control magnification. Loading Loading @@ -94,11 +93,6 @@ public class MagnificationKeyHandler extends BaseEventStreamTransformation { @Override public void onKeyEvent(KeyEvent event, int policyFlags) { if (!Flags.enableMagnificationKeyboardControl()) { // Send to the rest of the handlers. super.onKeyEvent(event, policyFlags); return; } // Look for exactly Alt and Meta. boolean modifiersPressed = event.isAltPressed() && event.isMetaPressed() && !event.isCtrlPressed() && !event.isShiftPressed(); Loading services/tests/servicestests/src/com/android/server/accessibility/AccessibilityInputFilterTest.java +0 −36 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEA import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_MAGNIFICATION_SINGLE_FINGER_TRIPLE_TAP; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_TOUCH_EXPLORATION; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_TRIGGERED_SCREEN_MAGNIFIER; import static com.android.server.accessibility.Flags.FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL; import static com.android.server.accessibility.Flags.FLAG_ONLY_RESET_MAGNIFICATION_IF_NEEDED_WHEN_DESTROY_HANDLER; import static org.junit.Assert.assertEquals; Loading Loading @@ -121,11 +120,6 @@ public class AccessibilityInputFilterTest { FullScreenMagnificationGestureHandler.class, TouchExplorer.class, AutoclickController.class, AccessibilityInputFilter.class}; private final Class[] mExpectedEventHandlerTypesWithoutMagKeyboard = {KeyboardInterceptor.class, MotionEventInjector.class, FullScreenMagnificationGestureHandler.class, TouchExplorer.class, AutoclickController.class, AccessibilityInputFilter.class}; @Mock private WindowManagerInternal.AccessibilityControllerInternal mMockA11yController; @Mock private WindowManagerInternal mMockWindowManagerService; @Mock private MagnificationProcessor mMockMagnificationProcessor; Loading Loading @@ -222,7 +216,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEventHandler_shouldIncreaseAndHaveCorrectOrderAfterOnDisplayAdded() { prepareLooper(); Loading Loading @@ -279,7 +272,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEventHandler_shouldHaveCorrectOrderForEventStreamTransformation() { prepareLooper(); Loading @@ -304,32 +296,6 @@ public class AccessibilityInputFilterTest { } } @Test @RequiresFlagsDisabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEventHandler_shouldHaveCorrectOrderForEventStreamTransformation_noMagKeys() { prepareLooper(); setDisplayCount(2); mA11yInputFilter.setUserAndEnabledFeatures(0, mFeatures); assertEquals(2, mEventHandler.size()); // Check if mEventHandler for each display has correct order of the // EventStreamTransformations. EventStreamTransformation next = mEventHandler.get(DEFAULT_DISPLAY); for (int i = 0; next != null; i++) { assertEquals(next.getClass(), mExpectedEventHandlerTypesWithoutMagKeyboard[i]); next = next.getNext(); } next = mEventHandler.get(SECOND_DISPLAY); // Start from index 1 because KeyboardInterceptor only exists in EventHandler for // DEFAULT_DISPLAY. for (int i = 1; next != null; i++) { assertEquals(next.getClass(), mExpectedEventHandlerTypesWithoutMagKeyboard[i]); next = next.getNext(); } } @Test public void testInputEvent_shouldDispatchToCorrespondingEventHandlers() { prepareLooper(); Loading Loading @@ -543,7 +509,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEnabledFeatures_windowMagnificationMode_expectedMagnificationKeyHandler() { prepareLooper(); doReturn(Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW).when( Loading @@ -556,7 +521,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEnabledFeatures_fullscreenMagnificationMode_expectedMagnificationKeyHandler() { prepareLooper(); doReturn(Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN).when( Loading Loading
services/accessibility/accessibility.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -155,13 +155,6 @@ flag { bug: "342509709" } flag { name: "enable_magnification_keyboard_control" namespace: "accessibility" description: "Whether to enable keyboard control for magnification" bug: "355487062" } flag { name: "enable_mouse_key_enhancement" namespace: "accessibility" Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityInputFilter.java +1 −2 Original line number Diff line number Diff line Loading @@ -820,8 +820,7 @@ public class AccessibilityInputFilter extends InputFilter implements EventStream } } if (Flags.enableMagnificationKeyboardControl() && isAnyMagnificationEnabled(mEnabledFeatures)) { if (isAnyMagnificationEnabled(mEnabledFeatures)) { mMagnificationKeyHandler = new MagnificationKeyHandler( mAms.getMagnificationController()); addFirstEventHandler(Display.DEFAULT_DISPLAY, mMagnificationKeyHandler); Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -5988,7 +5988,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub mNavigationModeUri, false, this, UserHandle.USER_ALL); contentResolver.registerContentObserver( mUserSetupCompleteUri, false, this, UserHandle.USER_ALL); if (isRepeatKeysFeatureFlagEnabled() && Flags.enableMagnificationKeyboardControl()) { if (isRepeatKeysFeatureFlagEnabled()) { contentResolver.registerContentObserver( mRepeatKeysEnabledUri, false, this, UserHandle.USER_ALL); contentResolver.registerContentObserver( Loading Loading @@ -6285,7 +6285,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub } boolean readRepeatKeysSettingsLocked(AccessibilityUserState userState) { if (!isRepeatKeysFeatureFlagEnabled() || !Flags.enableMagnificationKeyboardControl()) { if (!isRepeatKeysFeatureFlagEnabled()) { return false; } final boolean isRepeatKeysEnabled = Settings.Secure.getIntForUser( Loading
services/accessibility/java/com/android/server/accessibility/magnification/MagnificationKeyHandler.java +0 −6 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.view.Display; import android.view.KeyEvent; import com.android.server.accessibility.BaseEventStreamTransformation; import com.android.server.accessibility.Flags; /* * A class that listens to key presses used to control magnification. Loading Loading @@ -94,11 +93,6 @@ public class MagnificationKeyHandler extends BaseEventStreamTransformation { @Override public void onKeyEvent(KeyEvent event, int policyFlags) { if (!Flags.enableMagnificationKeyboardControl()) { // Send to the rest of the handlers. super.onKeyEvent(event, policyFlags); return; } // Look for exactly Alt and Meta. boolean modifiersPressed = event.isAltPressed() && event.isMetaPressed() && !event.isCtrlPressed() && !event.isShiftPressed(); Loading
services/tests/servicestests/src/com/android/server/accessibility/AccessibilityInputFilterTest.java +0 −36 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEA import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_MAGNIFICATION_SINGLE_FINGER_TRIPLE_TAP; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_TOUCH_EXPLORATION; import static com.android.server.accessibility.AccessibilityInputFilter.FLAG_FEATURE_TRIGGERED_SCREEN_MAGNIFIER; import static com.android.server.accessibility.Flags.FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL; import static com.android.server.accessibility.Flags.FLAG_ONLY_RESET_MAGNIFICATION_IF_NEEDED_WHEN_DESTROY_HANDLER; import static org.junit.Assert.assertEquals; Loading Loading @@ -121,11 +120,6 @@ public class AccessibilityInputFilterTest { FullScreenMagnificationGestureHandler.class, TouchExplorer.class, AutoclickController.class, AccessibilityInputFilter.class}; private final Class[] mExpectedEventHandlerTypesWithoutMagKeyboard = {KeyboardInterceptor.class, MotionEventInjector.class, FullScreenMagnificationGestureHandler.class, TouchExplorer.class, AutoclickController.class, AccessibilityInputFilter.class}; @Mock private WindowManagerInternal.AccessibilityControllerInternal mMockA11yController; @Mock private WindowManagerInternal mMockWindowManagerService; @Mock private MagnificationProcessor mMockMagnificationProcessor; Loading Loading @@ -222,7 +216,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEventHandler_shouldIncreaseAndHaveCorrectOrderAfterOnDisplayAdded() { prepareLooper(); Loading Loading @@ -279,7 +272,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEventHandler_shouldHaveCorrectOrderForEventStreamTransformation() { prepareLooper(); Loading @@ -304,32 +296,6 @@ public class AccessibilityInputFilterTest { } } @Test @RequiresFlagsDisabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEventHandler_shouldHaveCorrectOrderForEventStreamTransformation_noMagKeys() { prepareLooper(); setDisplayCount(2); mA11yInputFilter.setUserAndEnabledFeatures(0, mFeatures); assertEquals(2, mEventHandler.size()); // Check if mEventHandler for each display has correct order of the // EventStreamTransformations. EventStreamTransformation next = mEventHandler.get(DEFAULT_DISPLAY); for (int i = 0; next != null; i++) { assertEquals(next.getClass(), mExpectedEventHandlerTypesWithoutMagKeyboard[i]); next = next.getNext(); } next = mEventHandler.get(SECOND_DISPLAY); // Start from index 1 because KeyboardInterceptor only exists in EventHandler for // DEFAULT_DISPLAY. for (int i = 1; next != null; i++) { assertEquals(next.getClass(), mExpectedEventHandlerTypesWithoutMagKeyboard[i]); next = next.getNext(); } } @Test public void testInputEvent_shouldDispatchToCorrespondingEventHandlers() { prepareLooper(); Loading Loading @@ -543,7 +509,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEnabledFeatures_windowMagnificationMode_expectedMagnificationKeyHandler() { prepareLooper(); doReturn(Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW).when( Loading @@ -556,7 +521,6 @@ public class AccessibilityInputFilterTest { } @Test @RequiresFlagsEnabled(FLAG_ENABLE_MAGNIFICATION_KEYBOARD_CONTROL) public void testEnabledFeatures_fullscreenMagnificationMode_expectedMagnificationKeyHandler() { prepareLooper(); doReturn(Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN).when( Loading