Fix incorrect UI after triple-tap is disabled

The preference summary is not changed after
users disable the triple tap shortcut by the confirm
dialog. It is due to the fact that the fragment doesn't
observe the settings value change.

To fix it, we add the settings key to observe the change.

Bug: 208755360
Test: manual test
Change-Id: Ie5b7fc5e67c5491b53485af0d3d68d1789aeace4
This commit is contained in:
ryanlwlin
2021-12-02 20:51:21 +08:00
committed by Ryan Lin
parent 395ea90b83
commit a992b611bf
2 changed files with 15 additions and 3 deletions

View File

@@ -275,6 +275,13 @@ public class ToggleScreenMagnificationPreferenceFragment extends
return context.getText(resId);
}
@Override
protected List<String> getFeatureSettingsKeys() {
final List<String> shortcutKeys = super.getFeatureSettingsKeys();
shortcutKeys.add(Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED);
return shortcutKeys;
}
@Override
protected CharSequence getShortcutTypeSummary(Context context) {
if (!mShortcutPreference.isChecked()) {