Merge "Revert "Add the settings content observer for shortcut preference."" into rvc-dev am: 9ae5b47aee
am: 546c130e8d
am: f37eaffefc
am: aaf5e96718
Change-Id: I24e5a98e21353250b54e56ef3fe4dd62928b3b5e
This commit is contained in:
@@ -30,7 +30,6 @@ import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.text.Html;
|
||||
@@ -97,7 +96,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
private int mUserShortcutTypes = UserShortcutType.EMPTY;
|
||||
private CheckBox mSoftwareTypeCheckBox;
|
||||
private CheckBox mHardwareTypeCheckBox;
|
||||
private SettingsContentObserver mSettingsContentObserver;
|
||||
|
||||
// For html description of accessibility service, must follow the rule, such as
|
||||
// <img src="R.drawable.fileName"/>, a11y settings will get the resources successfully.
|
||||
@@ -135,17 +133,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
removeDialog(DialogEnums.EDIT_SHORTCUT);
|
||||
mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
|
||||
};
|
||||
|
||||
final List<String> shortcutFeatureKeys = new ArrayList<>();
|
||||
shortcutFeatureKeys.add(Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
|
||||
shortcutFeatureKeys.add(Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE);
|
||||
mSettingsContentObserver = new SettingsContentObserver(new Handler(), shortcutFeatureKeys) {
|
||||
@Override
|
||||
public void onChange(boolean selfChange, Uri uri) {
|
||||
updateShortcutPreferenceData();
|
||||
updateShortcutPreference();
|
||||
}
|
||||
};
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
@@ -242,7 +229,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
final AccessibilityManager am = getPrefContext().getSystemService(
|
||||
AccessibilityManager.class);
|
||||
am.addTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
|
||||
mSettingsContentObserver.register(getContentResolver());
|
||||
updateShortcutPreferenceData();
|
||||
updateShortcutPreference();
|
||||
}
|
||||
@@ -252,7 +238,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
final AccessibilityManager am = getPrefContext().getSystemService(
|
||||
AccessibilityManager.class);
|
||||
am.removeTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
|
||||
mSettingsContentObserver.unregister(getContentResolver());
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@@ -633,7 +618,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
getShortcutTypeSummary(getPrefContext()));
|
||||
}
|
||||
|
||||
protected void updateShortcutPreferenceData() {
|
||||
private void updateShortcutPreferenceData() {
|
||||
if (mComponentName == null) {
|
||||
return;
|
||||
}
|
||||
@@ -666,7 +651,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
mShortcutPreference.setTitle(title);
|
||||
}
|
||||
|
||||
protected void updateShortcutPreference() {
|
||||
private void updateShortcutPreference() {
|
||||
if (mComponentName == null) {
|
||||
return;
|
||||
}
|
||||
|
@@ -472,8 +472,7 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
||||
showDialog(DialogEnums.MAGNIFICATION_EDIT_SHORTCUT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateShortcutPreferenceData() {
|
||||
private void updateShortcutPreferenceData() {
|
||||
// Get the user shortcut type from settings provider.
|
||||
mUserShortcutType = getUserShortcutTypeFromSettings(getPrefContext());
|
||||
if (mUserShortcutType != UserShortcutType.EMPTY) {
|
||||
@@ -495,8 +494,7 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
||||
mShortcutPreference.setTitle(title);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateShortcutPreference() {
|
||||
private void updateShortcutPreference() {
|
||||
final int shortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
|
||||
mShortcutPreference.setChecked(
|
||||
hasMagnificationValuesInSettings(getPrefContext(), shortcutTypes));
|
||||
|
Reference in New Issue
Block a user