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
This commit is contained in:
@@ -45,13 +45,16 @@ public class InvisibleToggleAccessibilityServicePreferenceFragment extends
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@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
|
@Override
|
||||||
public void onCheckboxClicked(ShortcutPreference preference) {
|
public void onCheckboxClicked(ShortcutPreference preference) {
|
||||||
super.onCheckboxClicked(preference);
|
super.onCheckboxClicked(preference);
|
||||||
AccessibilityUtils.setAccessibilityServiceState(getContext(), mComponentName,
|
boolean enabled = getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED)
|
||||||
getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED));
|
&& preference.getChecked();
|
||||||
|
|
||||||
|
AccessibilityUtils.setAccessibilityServiceState(getContext(), mComponentName, enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user