Fix bug #16896118 SIM cards should ONLY appear in search results for devices with 2+ SIM slots
- add the proper SearchIndexProvider to SimSettings
- allow indexing only an only if showSimCardTile() is true
- add Utils.showSimCardTile()
Change-Id: I5df2284d32f91fa454e1edebf1139d00593138a0
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index df05adc..ba5c1e5 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -823,4 +823,16 @@
if (icon == null) return null;
return CircleFramedDrawable.getInstance(context, icon);
}
+
+ /**
+ * 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 showSimCardTile(Context context) {
+ final TelephonyManager tm =
+ (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+
+ return tm.getSimCount() > 0;
+ }
}