From 9e50eb15988a66cfb9fe92c0ab9caabccda7cc95 Mon Sep 17 00:00:00 2001 From: Peter_Liang Date: Fri, 24 Apr 2020 22:30:40 +0800 Subject: [PATCH] Add the enabled status into the condition for the service which is VolumeShortcutToggle type. Root cause: Shouldn't show the tutorial related to accessibility button when the service which has the accessibility button flag and is VolumeShortcutToggle type is not turned on. Next: Add the status of the corresponding service. Bug: 148989018 Test: manual test Change-Id: Icc1dc071387e34401ecf67ed9fbc7bd4f9f9d612 --- .../LegacyAccessibilityServicePreferenceFragment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java index 4fcfff8e7f7..c5cede3453e 100644 --- a/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java +++ b/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java @@ -52,11 +52,12 @@ public class LegacyAccessibilityServicePreferenceFragment extends @Override int getUserShortcutTypes() { int shortcutTypes = super.getUserShortcutTypes(); - + final boolean isServiceOn = + getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED); final AccessibilityServiceInfo info = getAccessibilityServiceInfo(); final boolean hasRequestAccessibilityButtonFlag = (info.flags & AccessibilityServiceInfo.FLAG_REQUEST_ACCESSIBILITY_BUTTON) != 0; - if (hasRequestAccessibilityButtonFlag) { + if (hasRequestAccessibilityButtonFlag && isServiceOn) { shortcutTypes |= UserShortcutType.SOFTWARE; } else { shortcutTypes &= (~UserShortcutType.SOFTWARE);