Add Indexable.SearchIndexProvider.getNonIndexableKeys(Context)

- getNonIndexableKeys(Context) allow a SearchIndexProvider to tell which data
he does not want to index by providing a list of the data keys
- use this new API for SoundSettings and removing KEY_EMERGENCY_TONE related
settings if the device is not CDMA
- add a BaseSearchIndexProvider for code simplification

Change-Id: I23633ace1d7e390ee05fac0a5458a33e04e72d8d
This commit is contained in:
Fabrice Di Meglio
2014-04-10 19:25:42 -07:00
parent a9d37050cb
commit 45f754e506
10 changed files with 152 additions and 76 deletions

View File

@@ -32,7 +32,6 @@ import android.preference.Preference;
import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.SearchIndexableResource;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
@@ -44,6 +43,7 @@ import android.widget.TextView;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settings.search.SearchIndexableRaw;
@@ -418,14 +418,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
}
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new SearchIndexProvider() {
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(
Context context, boolean enabled) {
return null;
}
new BaseSearchIndexProvider() {
@Override
public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {