Use searchable="false" to suppress nonIndexables.

When possible, remove or simplify getNonIndexable() logic in fragments,
and use searchable="false" in xml to suppress index.

Change-Id: I5bdf5bc7d5494a64cdd9e230a51321a4b210af69
Fixes: 112608186
Test: robotest and manual search
This commit is contained in:
Fan Zhang
2018-08-15 12:55:56 -07:00
parent 8419e4d127
commit 9ce4a1fcde
45 changed files with 134 additions and 286 deletions

View File

@@ -19,6 +19,8 @@ import android.app.Activity;
import android.content.Context;
import android.provider.SearchIndexableResource;
import androidx.annotation.VisibleForTesting;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -32,8 +34,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import androidx.annotation.VisibleForTesting;
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class ConnectedDeviceDashboardFragment extends DashboardFragment {
@@ -139,14 +139,5 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
@Override
public List<String> getNonIndexableKeys(Context context) {
List<String> keys = super.getNonIndexableKeys(context);
// Disable because they show dynamic data
keys.add(KEY_AVAILABLE_DEVICES);
keys.add(KEY_CONNECTED_DEVICES);
return keys;
}
};
}