summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauloftheWest <paulofthewest@google.com>2014-12-15 10:29:54 -0800
committerThe Android Automerger <android-build@google.com>2014-12-16 15:00:20 -0800
commitf92e36859b3f8131a38d1340d3f9c5405ab4daaa (patch)
tree1754d809e44c574c2ceab4b6582948fe10aa96a2
parentaff1300c0e9dc5595d88b291d4c8122eb2a320a0 (diff)
downloadpackages_apps_Settings-f92e36859b3f8131a38d1340d3f9c5405ab4daaa.tar.gz
packages_apps_Settings-f92e36859b3f8131a38d1340d3f9c5405ab4daaa.tar.bz2
packages_apps_Settings-f92e36859b3f8131a38d1340d3f9c5405ab4daaa.zip
IMEI information will show without a SIM.
Bug: 18701340 Change-Id: I1e92bd1af4d68849f194d30b5b894cfb144900e5
-rw-r--r--src/com/android/settings/deviceinfo/ImeiInformation.java24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/com/android/settings/deviceinfo/ImeiInformation.java b/src/com/android/settings/deviceinfo/ImeiInformation.java
index 72d3158706..38fd3357bb 100644
--- a/src/com/android/settings/deviceinfo/ImeiInformation.java
+++ b/src/com/android/settings/deviceinfo/ImeiInformation.java
@@ -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) {