Make ColorAndMotionFragment fully in Catalyst

Bug: 392190782
Test: manual (verify the navigation and the search still works the same)
Test: atest
Flag: com.android.settings.flags.catalyst_accessibility_color_and_motion

Change-Id: I7717390c70246503aec545991fd9a40be5152373
This commit is contained in:
Chun-Ku Lin
2025-01-25 01:22:03 +00:00
parent 22e56834fd
commit 0f84b652cc
10 changed files with 456 additions and 21 deletions

View File

@@ -308,7 +308,10 @@ public abstract class ToggleFeaturePreferenceFragment extends DashboardFragment
getActivity().setTitle(title);
}
protected void onProcessArguments(Bundle arguments) {
protected void onProcessArguments(@Nullable Bundle arguments) {
if (arguments == null) {
return;
}
// Key.
mPreferenceKey = arguments.getString(AccessibilitySettings.EXTRA_PREFERENCE_KEY);
@@ -432,7 +435,8 @@ public abstract class ToggleFeaturePreferenceFragment extends DashboardFragment
private void initToggleServiceSwitchPreference() {
mToggleServiceSwitchPreference = new SettingsMainSwitchPreference(getPrefContext());
mToggleServiceSwitchPreference.setKey(getUseServicePreferenceKey());
if (getArguments().containsKey(AccessibilitySettings.EXTRA_CHECKED)) {
if (getArguments() != null
&& getArguments().containsKey(AccessibilitySettings.EXTRA_CHECKED)) {
final boolean enabled = getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED);
mToggleServiceSwitchPreference.setChecked(enabled);
}