diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-02-27 04:09:14 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-02-27 04:09:14 +0000 |
commit | 4384d8abcec1bc696ef735e78a05a21e92b8f3ad (patch) | |
tree | 872fce39f540b1f879659117c789e5566dfc1609 | |
parent | 4bd76852f73a453e4267a003937c9422c79b07b0 (diff) | |
parent | a8d19611953850a576e360e52a136a11e6fcfa63 (diff) | |
download | EmergencyInfo-4384d8abcec1bc696ef735e78a05a21e92b8f3ad.tar.gz |
Snap for 5339364 from a8d19611953850a576e360e52a136a11e6fcfa63 to qt-release
Change-Id: I89591e34b056282fd1fe23905695c8c49fb2cabe
-rw-r--r-- | res/values/config.xml | 2 | ||||
-rw-r--r-- | src/com/android/emergency/EmergencySearchIndexablesProvider.java | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index 54792d2b..6a4cde6b 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -18,4 +18,6 @@ <!-- Fully-qualified class name for the implementation of the FeatureFactory to be instantiated. --> <string name="config_featureFactory" translatable="false">com.android.emergency.overlay.FeatureFactoryImpl</string> + <!-- Flag to enable search index feature in Settings. --> + <bool name="config_search_index_disabled">false</bool> </resources> diff --git a/src/com/android/emergency/EmergencySearchIndexablesProvider.java b/src/com/android/emergency/EmergencySearchIndexablesProvider.java index 28ce01b4..92dfb8dd 100644 --- a/src/com/android/emergency/EmergencySearchIndexablesProvider.java +++ b/src/com/android/emergency/EmergencySearchIndexablesProvider.java @@ -21,6 +21,7 @@ import android.database.MatrixCursor; import android.provider.SearchIndexablesContract.XmlResource; import android.provider.SearchIndexableResource; import android.provider.SearchIndexablesProvider; +import android.util.FeatureFlagUtils; import com.android.emergency.edit.EditInfoActivity; import com.android.emergency.edit.EditMedicalInfoActivity; @@ -50,6 +51,11 @@ public class EmergencySearchIndexablesProvider extends SearchIndexablesProvider @Override public Cursor queryXmlResources(String[] projection) { + if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlagUtils.SAFETY_HUB) + && getContext().getResources().getBoolean(R.bool.config_search_index_disabled)) { + return null; + } + MatrixCursor cursor = new MatrixCursor(INDEXABLES_XML_RES_COLUMNS); for (int i = 0, length = INDEXABLE_RES.length; i < length; i++) { cursor.newRow() @@ -66,13 +72,11 @@ public class EmergencySearchIndexablesProvider extends SearchIndexablesProvider @Override public Cursor queryRawData(String[] projection) { - MatrixCursor cursor = new MatrixCursor(INDEXABLES_RAW_COLUMNS); - return cursor; + return null; } @Override public Cursor queryNonIndexableKeys(String[] projection) { - MatrixCursor cursor = new MatrixCursor(NON_INDEXABLES_KEYS_COLUMNS); - return cursor; + return null; } } |