From 00329792d2eaad9f0cd24db1660df881b1be7538 Mon Sep 17 00:00:00 2001 From: Thomas Leu Date: Thu, 16 Feb 2023 11:27:25 +0000 Subject: Revert "Fix the accessibility shortcut funtionaility." This reverts commit 72c52dfb48ccc051c487a2796efb09aa6657464f. Reason for revert: The original commit only changed what was displayed in the settings, but not the actual value of the setting that was used during the shortcut operation. Bug: b/269693551 Test: Locally tested on adt4-userdebug that the shortcut does not show TalkBack as target service if it is set to an empty string and the settings are opened for the very first time. Change-Id: Ife2e098d1e55ed94efb2426505872546b27bc3bb (cherry picked from commit db7d6590a301a89a94d8e72103a5ad419f208537) Merged-In: Ife2e098d1e55ed94efb2426505872546b27bc3bb --- .../src/com/android/settingslib/accessibility/AccessibilityUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityUtils.java b/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityUtils.java index 85e8aad38808..59735f413f9d 100644 --- a/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityUtils.java +++ b/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityUtils.java @@ -183,7 +183,7 @@ public class AccessibilityUtils { final String currentShortcutServiceId = Settings.Secure.getStringForUser( context.getContentResolver(), Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, userId); - if (!TextUtils.isEmpty(currentShortcutServiceId)) { + if (currentShortcutServiceId != null) { return currentShortcutServiceId; } return context.getString(R.string.config_defaultAccessibilityService); -- cgit v1.2.3-59-g8ed1b From 10de3c6dcb2a22c94b789a1373ef75cb0b7c0096 Mon Sep 17 00:00:00 2001 From: Thomas Leu Date: Fri, 17 Feb 2023 10:43:14 +0100 Subject: 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 (cherry picked from commit c13d2ac160fc68c0e4697dcfa8d2f53e81914610) Merged-In: I2d41d14fd60aa1c0c8856c6a8c72250cc72d813a --- .../internal/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 ef255012b870..b83d1d83f036 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, -- cgit v1.2.3-59-g8ed1b