am 682b7ed3: Merge "IMEI information will show without a SIM." into lmp-mr1-dev
* commit '682b7ed34c01ea65edfe034afe52180052b9e2fc':
IMEI information will show without a SIM.
diff --git a/src/com/android/settings/deviceinfo/ImeiInformation.java b/src/com/android/settings/deviceinfo/ImeiInformation.java
index 72d3158..38fd335 100644
--- a/src/com/android/settings/deviceinfo/ImeiInformation.java
+++ b/src/com/android/settings/deviceinfo/ImeiInformation.java
@@ -63,8 +63,8 @@
}
}
- 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 @@
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 @@
}
}
- 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) {