Fix search highlight

- Fragments should not have advanced button when coming from search.

Change-Id: I10a192216b7ff702e73b791acbcc1eb1d71cb407
Fixes: 73348428
Test: robotests
This commit is contained in:
Fan Zhang
2018-02-20 11:25:56 -08:00
parent 6f367a79ce
commit 72456a9ea6
6 changed files with 118 additions and 43 deletions

View File

@@ -67,15 +67,13 @@ public class LocationSettings extends DashboardFragment {
private LocationSwitchBarController mSwitchBarController;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
public int getInitialExpandedChildCount() {
final RecentLocationApps recentLocationApps = new RecentLocationApps(getActivity());
int locationRequestsApps = recentLocationApps.getAppList().size();
int locationRequestsPrefs = locationRequestsApps == 0 ? 1 : locationRequestsApps;
getPreferenceScreen().setInitialExpandedChildrenCount(locationRequestsPrefs + 2);
final int locationRequestsApps = recentLocationApps.getAppList().size();
final int locationRequestsPrefs = locationRequestsApps == 0 ? 1 : locationRequestsApps;
return locationRequestsPrefs + 2;
}
@Override
public int getMetricsCategory() {
return MetricsEvent.LOCATION;