Adjust preferene to align the lastest mock
- Because removeAll in updateState will cause preference list janking, move updateState code to displayPreference. Bug: 141601408 Fixes: 145369584 Test: manual and robolectric Change-Id: Ic6ffeedfdd7a64671e497a61894d7c0d443750ef
This commit is contained in:
@@ -74,12 +74,7 @@ public class RecentLocationRequestPreferenceController extends LocationBasePrefe
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
mCategoryRecentLocationRequests = screen.findPreference(getPreferenceKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
mCategoryRecentLocationRequests.removeAll();
|
||||
final Context prefContext = preference.getContext();
|
||||
final Context prefContext = mCategoryRecentLocationRequests.getContext();
|
||||
final List<RecentLocationApps.Request> recentLocationRequests =
|
||||
mRecentLocationApps.getAppListSorted(false);
|
||||
if (recentLocationRequests.size() > 3) {
|
||||
|
Reference in New Issue
Block a user