Merge "Update A11ySettings to load preferences in onCreate()." into main

This commit is contained in:
Daniel Norman
2024-06-03 19:06:23 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 6 deletions

View File

@@ -210,24 +210,31 @@ public class AccessibilitySettings extends DashboardFragment implements
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
initializeAllPreferences();
updateAllPreferences();
mNeedPreferencesUpdate = false;
registerContentMonitors();
registerInputDeviceListener();
}
@Override
public void onResume() {
super.onResume();
updateAllPreferences();
public void onStart() {
super.onStart();
mIsForeground = true;
}
@Override
public void onStart() {
public void onResume() {
super.onResume();
if (mNeedPreferencesUpdate) {
updateAllPreferences();
mNeedPreferencesUpdate = false;
}
mIsForeground = true;
super.onStart();
}
@Override
public void onPause() {
super.onPause();
mNeedPreferencesUpdate = true;
}
@Override

View File

@@ -385,6 +385,7 @@ public class AccessibilitySettingsTest {
mFragment.onContentChanged();
mFragment.onStart();
mFragment.onResume();
RestrictedPreference preference = mFragment.getPreferenceScreen().findPreference(
COMPONENT_NAME.flattenToString());