summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/sim/SimSettings.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-08-08 19:35:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-08 17:26:08 +0000
commit09076e5f3c90dbc1a3bdf6f000e0c99dd2bb45b4 (patch)
tree6dcf9a99b58418c262a22c2f48c577f967bddac8 /src/com/android/settings/sim/SimSettings.java
parentdc16286ff32dfc4d087938461d0beca29b6167a3 (diff)
parent22a2a49b445b8721c8194eedf3608ea81c62ccef (diff)
downloadpackages_apps_Settings-09076e5f3c90dbc1a3bdf6f000e0c99dd2bb45b4.zip
packages_apps_Settings-09076e5f3c90dbc1a3bdf6f000e0c99dd2bb45b4.tar.gz
packages_apps_Settings-09076e5f3c90dbc1a3bdf6f000e0c99dd2bb45b4.tar.bz2
Merge "Fix bug #16896118 SIM cards should ONLY appear in search results for devices with 2+ SIM slots" into lmp-dev
Diffstat (limited to 'src/com/android/settings/sim/SimSettings.java')
-rw-r--r--src/com/android/settings/sim/SimSettings.java36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/com/android/settings/sim/SimSettings.java b/src/com/android/settings/sim/SimSettings.java
index 15c5548..9762c51 100644
--- a/src/com/android/settings/sim/SimSettings.java
+++ b/src/com/android/settings/sim/SimSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.sim;
+import android.provider.SearchIndexableResource;
import com.android.settings.R;
import android.app.AlertDialog;
@@ -55,6 +56,7 @@ import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyIntents;
import com.android.settings.RestrictedSettingsFragment;
import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
import com.android.settings.notification.DropDownPreference;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -86,18 +88,6 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
private SubInfoRecord mCalls = null;
private SubInfoRecord mSMS = null;
- /**
- * Return whether or not the user should have a SIM Cards option in Settings.
- * TODO: Change back to returning true if count is greater than one after testing.
- * TODO: See bug 16533525.
- */
- public static boolean showSimCardScreen(Context context) {
- final TelephonyManager tm =
- (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
-
- return tm.getSimCount() > 0;
- }
-
public SimSettings() {
super(DISALLOW_CONFIG_SIM);
}
@@ -369,4 +359,26 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
builder.create().show();
}
}
+
+ /**
+ * For search
+ */
+ public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+ new BaseSearchIndexProvider() {
+ @Override
+ public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
+ boolean enabled) {
+ ArrayList<SearchIndexableResource> result =
+ new ArrayList<SearchIndexableResource>();
+
+ if (Utils.showSimCardTile(context)) {
+ SearchIndexableResource sir = new SearchIndexableResource(context);
+ sir.xmlResId = R.xml.sim_settings;
+ result.add(sir);
+ }
+
+ return result;
+ }
+ };
+
}