Merge "Check if the slot info is null to avoid exception" into sc-qpr1-dev am: 915fe99ce4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15730083

Change-Id: I8a9dd44e4e8d05752ccdd75507a5dc974716ce16
This commit is contained in:
Hui Wang
2021-09-01 21:22:23 +00:00
committed by Automerger Merge Worker

View File

@@ -3483,7 +3483,8 @@ public class TelephonyManager {
*/ */
private int getLogicalSlotIndex(int physicalSlotIndex) { private int getLogicalSlotIndex(int physicalSlotIndex) {
UiccSlotInfo[] slotInfos = getUiccSlotsInfo(); UiccSlotInfo[] slotInfos = getUiccSlotsInfo();
if (slotInfos != null && physicalSlotIndex >= 0 && physicalSlotIndex < slotInfos.length) { if (slotInfos != null && physicalSlotIndex >= 0 && physicalSlotIndex < slotInfos.length
&& slotInfos[physicalSlotIndex] != null) {
return slotInfos[physicalSlotIndex].getLogicalSlotIdx(); return slotInfos[physicalSlotIndex].getLogicalSlotIdx();
} }