From 72c52dfb48ccc051c487a2796efb09aa6657464f Mon Sep 17 00:00:00 2001 From: Kaiqiang Wang Date: Mon, 12 Sep 2022 23:50:13 +0200 Subject: [PATCH] Fix the accessibility shortcut funtionaility. 1) Set default value when the Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE is empty. 2) Fix the filter condition to check if the value is empty or not. Root cause of the issue: the value of ACCESSIBILITY_SHORTCUT_TARGET_SERVICE is "", an empty string, which make a11y shortcut no responisble. Preview: https://screenshot.googleplex.com/YWMnRGsPTm4hz6X Test: tested on ADT3 Bug: 244128422 Change-Id: Id6f9d6f2ca90b79ff35ee5b14579915f059deb13 --- .../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 59735f413f9db..85e8aad38808b 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 (currentShortcutServiceId != null) { + if (!TextUtils.isEmpty(currentShortcutServiceId)) { return currentShortcutServiceId; } return context.getString(R.string.config_defaultAccessibilityService);