Fix flicker in Location page when location is off

Caused by the recent location access preferences not have there initial
visible stats set before creating the view.

Refresh the location stats in displayPreference() for them to fix.

Fix: 232342339
Test: manual visual
Change-Id: I4023fd3a5860490e9c6cb733933a19f96824a53d
This commit is contained in:
Chaohui Wang
2022-05-17 10:34:31 +08:00
parent c4899bf019
commit f9ebeadb33
2 changed files with 2 additions and 0 deletions

View File

@@ -90,6 +90,7 @@ public class RecentLocationAccessPreferenceController extends LocationBasePrefer
public void displayPreference(PreferenceScreen screen) { public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen); super.displayPreference(screen);
mCategoryRecentLocationRequests = screen.findPreference(getPreferenceKey()); mCategoryRecentLocationRequests = screen.findPreference(getPreferenceKey());
mLocationEnabler.refreshLocationMode();
loadRecentAccesses(); loadRecentAccesses();
} }

View File

@@ -39,6 +39,7 @@ public class RecentLocationAccessSeeAllButtonPreferenceController extends
public void displayPreference(PreferenceScreen screen) { public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen); super.displayPreference(screen);
mPreference = screen.findPreference(getPreferenceKey()); mPreference = screen.findPreference(getPreferenceKey());
mLocationEnabler.refreshLocationMode();
} }
@Override @Override