Provides an ordered array of shortcut types so Settings presents shortcuts in the desired order

NO_IFTTT=corrects ui order
Flag: android.provider.a11y_standalone_gesture_enabled
Test: atest AccessibilityUtilTest
Bug: 371463731

Change-Id: Ia1864076faa281cf57c469a2d0d34f859858d859
This commit is contained in:
Riley Jones
2024-10-08 21:33:55 +00:00
parent ae24d51b1b
commit ea06748ee2
5 changed files with 18 additions and 22 deletions

View File

@@ -30,7 +30,6 @@ import android.view.accessibility.Flags;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.android.internal.accessibility.common.ShortcutConstants;
import com.android.internal.accessibility.common.ShortcutConstants.UserShortcutType;
import com.android.internal.accessibility.util.ShortcutUtils;
@@ -123,7 +122,7 @@ public final class PreferredShortcuts {
public static void updatePreferredShortcutsFromSettings(
@NonNull Context context, @NonNull Set<String> components) {
final Map<Integer, Set<String>> shortcutTypeToTargets = new ArrayMap<>();
for (int shortcutType : ShortcutConstants.USER_SHORTCUT_TYPES) {
for (int shortcutType : AccessibilityUtil.SHORTCUTS_ORDER_IN_UI) {
if (!Flags.a11yQsShortcut()
&& shortcutType == QUICK_SETTINGS) {
// Skip saving quick setting as preferred shortcut option when flag is not enabled