Cleanup deprecated functions in AccessibilityUtil

Flag: EXEMPT code cleanup
Bug: 367414968
Test: atest com.android.settings.accessibility
Change-Id: If69a964720fc91ce0ad3661f956c4818f4f2f9dd
This commit is contained in:
Riley Jones
2024-12-04 00:24:16 +00:00
parent 1b53ae5649
commit 6107fd8591
7 changed files with 27 additions and 197 deletions

View File

@@ -22,6 +22,7 @@ import static com.android.settings.accessibility.AccessibilityUtil.getShortcutSu
import static com.android.settings.accessibility.ToggleFeaturePreferenceFragment.KEY_GENERAL_CATEGORY;
import static com.android.settings.accessibility.ToggleFeaturePreferenceFragment.KEY_SAVED_QS_TOOLTIP_TYPE;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.app.settings.SettingsEnums;
@@ -51,6 +52,7 @@ import com.google.android.setupcompat.util.WizardManagerHelper;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* Base class for accessibility fragments shortcut functions and dialog management.
@@ -232,6 +234,7 @@ public abstract class AccessibilityShortcutPreferenceFragment extends Restricted
);
}
@SuppressLint("MissingPermission")
@Override
public void onToggleClicked(ShortcutPreference preference) {
if (getComponentName() == null) {
@@ -239,13 +242,12 @@ public abstract class AccessibilityShortcutPreferenceFragment extends Restricted
}
final int shortcutTypes = getUserPreferredShortcutTypes();
if (preference.isChecked()) {
AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes,
getComponentName());
final boolean isChecked = preference.isChecked();
getPrefContext().getSystemService(AccessibilityManager.class).enableShortcutsForTargets(
isChecked, shortcutTypes,
Set.of(getComponentName().flattenToString()), getPrefContext().getUserId());
if (isChecked) {
showDialog(DialogEnums.LAUNCH_ACCESSIBILITY_TUTORIAL);
} else {
AccessibilityUtil.optOutAllValuesFromSettings(getPrefContext(), shortcutTypes,
getComponentName());
}
mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
}