From c13d2ac160fc68c0e4697dcfa8d2f53e81914610 Mon Sep 17 00:00:00 2001 From: Thomas Leu Date: Fri, 17 Feb 2023 10:43:14 +0100 Subject: [PATCH] Do not disable the default shortcut at the end of setup. At the end of the setup process, the default Accessibility Shortcut target service gets disabled. This makes sense on Mobile, where many users would trigger the shortcut accidentally. However on TV, we find that to be very unlikely and would like to keep the shortcut enabled. Bug: b/269689576 Test: Locally tested on adt4-userdebug that the shortcut works during setup, and after setup if not pressed during setup (factory reset in between). Change-Id: I2d41d14fd60aa1c0c8856c6a8c72250cc72d813a --- .../accessibility/AccessibilityShortcutController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/com/android/internal/accessibility/AccessibilityShortcutController.java b/core/java/com/android/internal/accessibility/AccessibilityShortcutController.java index ef255012b8707..b83d1d83f0363 100644 --- a/core/java/com/android/internal/accessibility/AccessibilityShortcutController.java +++ b/core/java/com/android/internal/accessibility/AccessibilityShortcutController.java @@ -650,6 +650,11 @@ public class AccessibilityShortcutController { * */ private void setEmptyShortcutTargetIfNeeded() { + if (hasFeatureLeanback()) { + // Do not disable the default shortcut on TV. + return; + } + final ContentResolver contentResolver = mContext.getContentResolver(); final String shortcutTargets = Settings.Secure.getStringForUser(contentResolver,