Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9396835 authored by PauloftheWest's avatar PauloftheWest Committed by Android Git Automerger
Browse files

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

* commit '29db97d1':
  IMEI information will show without a SIM.
parents befc1267 29db97d1
Loading
Loading
Loading
Loading
+3 −21
Original line number Diff line number Diff line
@@ -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) {