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

Commit 187ab7df authored by arunvoddu's avatar arunvoddu Committed by Arun Voddu
Browse files

NPE fix when reading the port index from uiccslot in logger

Bug: 281967625
Test: atest tests/telephonytests/src/com/android/internal/telephony/uicc
Change-Id: I5b21b400092a556bc172f88c092d29d77e27d240
parent 13cf841a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -833,12 +833,14 @@ public class UiccController extends Handler {
            UiccSlot slot = UiccController.getInstance().getUiccSlotForPhone(phoneId);
            int slotId = UiccController.getInstance().getSlotIdFromPhoneId(phoneId);
            intent.putExtra(PhoneConstants.SLOT_KEY, slotId);
            int portIndex = -1;
            if (slot != null) {
                intent.putExtra(PhoneConstants.PORT_KEY, slot.getPortIndexFromPhoneId(phoneId));
                portIndex = slot.getPortIndexFromPhoneId(phoneId);
                intent.putExtra(PhoneConstants.PORT_KEY, portIndex);
            }
            Rlog.d(LOG_TAG, "Broadcasting intent ACTION_SIM_CARD_STATE_CHANGED "
                    + TelephonyManager.simStateToString(state) + " for phone: " + phoneId
                    + " slot: " + slotId + " port: " + slot.getPortIndexFromPhoneId(phoneId));
                    + " slot: " + slotId + " port: " + portIndex);
            mContext.sendBroadcast(intent, Manifest.permission.READ_PRIVILEGED_PHONE_STATE);
            TelephonyMetrics.getInstance().updateSimState(phoneId, state);
        }