am 29db97d1: am 682b7ed3: Merge "IMEI information will show without a SIM." into lmp-mr1-dev

* commit '29db97d1189a885324d950ecb3a2e80d1eabaece':
  IMEI information will show without a SIM.
This commit is contained in:
PauloftheWest
2014-12-15 21:45:37 +00:00
committed by Android Git Automerger

View File

@@ -63,8 +63,8 @@ public class ImeiInformation extends PreferenceActivity {
}
}
private void setPreferenceValue(int slotId) {
final Phone phone = getPhoneFromSlotId(slotId);
private void setPreferenceValue(int phoneId) {
final Phone phone = PhoneFactory.getPhone(phoneId);
if (phone != null) {
if (phone.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
@@ -92,7 +92,7 @@ public class ImeiInformation extends PreferenceActivity {
setSummaryText(KEY_IMEI, phone.getDeviceId());
setSummaryText(KEY_IMEI_SV,
((TelephonyManager) getSystemService(TELEPHONY_SERVICE))
.getDeviceSoftwareVersion(/*slotId*/));
.getDeviceSoftwareVersion(phoneId));
// device is not CDMA, do not display CDMA features
// check Null in case no specified preference in overlay xml
removePreferenceFromScreen(KEY_PRL_VERSION);
@@ -103,24 +103,6 @@ public class ImeiInformation extends PreferenceActivity {
}
}
private Phone getPhoneFromSlotId(int slotIdx) {
final SubscriptionInfo subInfo =
mSubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(slotIdx);
if (subInfo == null) {
return null;
}
final Phone[] phones = PhoneFactory.getPhones();
for (int i = 0; i < phones.length; i++) {
if (phones[i].getSubId() == subInfo.getSubscriptionId()) {
return phones[i];
}
}
return null;
}
// Modify the preference key with prefix "_", so new added information preference can be set
// related phone information.
private void setNewKey(int slotId) {