Merge "Add the enabled status into the condition for the service which is VolumeShortcutToggle type." into rvc-dev am: c0fc0e4542 am: 6597cf6cb2

Change-Id: I734588ccdd71aca775d98fefec63a6782bcc4e3f
This commit is contained in:
PETER LIANG
2020-04-27 07:56:42 +00:00
committed by Automerger Merge Worker

View File

@@ -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);