summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/DevelopmentSettings.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-07-25 16:28:53 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2014-07-25 16:28:53 -0700
commit2ec78636f75964a48be5e95fe9b7e71f2270f917 (patch)
tree81d10cc30c4eb64ed14088d5b6feb9f3c14aef17 /src/com/android/settings/DevelopmentSettings.java
parentb7bd72f297c9a33e7d819e3a309d304eac165919 (diff)
downloadpackages_apps_Settings-2ec78636f75964a48be5e95fe9b7e71f2270f917.zip
packages_apps_Settings-2ec78636f75964a48be5e95fe9b7e71f2270f917.tar.gz
packages_apps_Settings-2ec78636f75964a48be5e95fe9b7e71f2270f917.tar.bz2
Implement #15841213 Search - index Developer Option only and only if they have been activated
- do not index Developer Options if they are not activated - index them just after their activation Change-Id: I54fcc6b55a1f29eb6b19d6e14e3158d4a38a6fe6
Diffstat (limited to 'src/com/android/settings/DevelopmentSettings.java')
-rw-r--r--src/com/android/settings/DevelopmentSettings.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index c7d945d..60116da 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -1586,9 +1586,22 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
*/
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
+
+ private boolean isShowingDeveloperOptions(Context context) {
+ return context.getSharedPreferences(DevelopmentSettings.PREF_FILE,
+ Context.MODE_PRIVATE).getBoolean(
+ DevelopmentSettings.PREF_SHOW,
+ android.os.Build.TYPE.equals("eng"));
+ }
+
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(
Context context, boolean enabled) {
+
+ if (!isShowingDeveloperOptions(context)) {
+ return null;
+ }
+
final SearchIndexableResource sir = new SearchIndexableResource(context);
sir.xmlResId = R.xml.development_prefs;
return Arrays.asList(sir);
@@ -1596,6 +1609,10 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
@Override
public List<String> getNonIndexableKeys(Context context) {
+ if (!isShowingDeveloperOptions(context)) {
+ return null;
+ }
+
final List<String> keys = new ArrayList<String>();
if (!showEnableOemUnlockPreference()) {
keys.add(ENABLE_OEM_UNLOCK);