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

@@ -72,6 +72,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 with toggle, shortcut, some helper functions
@@ -685,13 +686,12 @@ public abstract class ToggleFeaturePreferenceFragment extends DashboardFragment
}
final int shortcutTypes = getUserPreferredShortcutTypes();
if (preference.isChecked()) {
AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes,
mComponentName);
final boolean isChecked = preference.isChecked();
getPrefContext().getSystemService(AccessibilityManager.class).enableShortcutsForTargets(
isChecked, shortcutTypes,
Set.of(mComponentName.flattenToString()), getPrefContext().getUserId());
if (isChecked) {
showDialog(DialogEnums.LAUNCH_ACCESSIBILITY_TUTORIAL);
} else {
AccessibilityUtil.optOutAllValuesFromSettings(getPrefContext(), shortcutTypes,
mComponentName);
}
mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
}