From 83efd61ed5aff70af964eb144e29707fd6a11753 Mon Sep 17 00:00:00 2001 From: Josep del Rio Date: Wed, 10 May 2023 11:04:47 +0000 Subject: [PATCH] Use Ctrl+Tab to navigate focus clusters As part of Android U, the Meta+Tab shortcut now opens the recent apps. Unfortunately, that blocked that shortcut from arriving to the app ViewRootImpl, which was currently used to navigate focus clusters. That means that some elements will not be reachable using the keyboard, which is a big problem for acessability. This CL changes the Meta+Tab to Ctrl+Tab, which is not assigned to any shortcut. Bug: 278932280 Test: Flashed on device, confirmed that the cluster focus moves Change-Id: Ib2811bb9d7eeb39f8c184fb4824468d3d1d28c23 --- core/java/android/view/ViewRootImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index f662c73726679..4cbb0409dafcf 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -6969,10 +6969,10 @@ public final class ViewRootImpl implements ViewParent, if (event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_TAB) { - if (KeyEvent.metaStateHasModifiers(event.getMetaState(), KeyEvent.META_META_ON)) { + if (KeyEvent.metaStateHasModifiers(event.getMetaState(), KeyEvent.META_CTRL_ON)) { groupNavigationDirection = View.FOCUS_FORWARD; } else if (KeyEvent.metaStateHasModifiers(event.getMetaState(), - KeyEvent.META_META_ON | KeyEvent.META_SHIFT_ON)) { + KeyEvent.META_CTRL_ON | KeyEvent.META_SHIFT_ON)) { groupNavigationDirection = View.FOCUS_BACKWARD; } }