Removed extraneous slot information on single SIM devices.

Bug: 18803333
Change-Id: If18f898839a1b7927a8db3b225549d4e4e073fdc
This commit is contained in:
PauloftheWest
2014-12-18 15:02:39 -08:00
parent c4cc07b2c7
commit a68bdb6dbe

View File

@@ -43,6 +43,7 @@ public class ImeiInformation extends PreferenceActivity {
private static final String KEY_IMEI_SV = "imei_sv"; private static final String KEY_IMEI_SV = "imei_sv";
private SubscriptionManager mSubscriptionManager; private SubscriptionManager mSubscriptionManager;
private boolean isMultiSIM = false;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -56,6 +57,7 @@ public class ImeiInformation extends PreferenceActivity {
// Since there are multiple phone for dsds, therefore need to show information for different // Since there are multiple phone for dsds, therefore need to show information for different
// phones. // phones.
private void initPreferenceScreen(int slotCount) { private void initPreferenceScreen(int slotCount) {
isMultiSIM = (slotCount > 1);
for (int slotId = 0; slotId < slotCount; slotId ++) { for (int slotId = 0; slotId < slotCount; slotId ++) {
addPreferencesFromResource(R.xml.device_info_phone_status); addPreferencesFromResource(R.xml.device_info_phone_status);
setPreferenceValue(slotId); setPreferenceValue(slotId);
@@ -122,8 +124,10 @@ public class ImeiInformation extends PreferenceActivity {
private void updateTitle(Preference pref, int slotId) { private void updateTitle(Preference pref, int slotId) {
if (pref != null) { if (pref != null) {
String title = pref.getTitle().toString(); String title = pref.getTitle().toString();
// Slot starts from 1, slotId starts from 0 so plus 1 if (isMultiSIM) {
title = title + getResources().getString(R.string.slot_number, slotId + 1); // Slot starts from 1, slotId starts from 0 so plus 1
title += " " + getResources().getString(R.string.slot_number, slotId + 1);
}
pref.setTitle(title); pref.setTitle(title);
} }
} }