Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46050053 authored by jasonwshsu's avatar jasonwshsu
Browse files

Accessibility shortcut secondary action - correct invisible type fragment checkbox logic

- checkbox logic need to follow shortcutPreference checked status

Bug: 142530063
Test: manual
Change-Id: Ibc079f116c16b6e1c32b573de693b4a23388858c
parent 8b1bf8a4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -45,13 +45,16 @@ public class InvisibleToggleAccessibilityServicePreferenceFragment extends
    /**
     * {@inheritDoc}
     *
     * Enables accessibility service only when user had allowed permission.
     * Enables accessibility service only when user had allowed permission. Disables
     * accessibility service when shortcutPreference is unchecked.
     */
    @Override
    public void onCheckboxClicked(ShortcutPreference preference) {
        super.onCheckboxClicked(preference);
        AccessibilityUtils.setAccessibilityServiceState(getContext(), mComponentName,
                getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED));
        boolean enabled = getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED)
                && preference.getChecked();

        AccessibilityUtils.setAccessibilityServiceState(getContext(), mComponentName, enabled);
    }

    /**