From 02cc3745cbe602f6e62ee1020fd0974c3493edf7 Mon Sep 17 00:00:00 2001 From: Michael Hoisie Date: Sun, 10 Jul 2022 21:46:54 +0000 Subject: [PATCH] Initialize port list in UiccSlotInfo constuctor UiccSlotInfo.getPorts() assumes a non-null port list. Ensure that the port list is initialized in the (now deprecated) public constructor. If it is initialized to null, and getPorts is called, an NPE will occur. This came up in a setupwizard test that was using the UiccPortInfo constructor and calling getPorts(). Test: setupwizard SlotsSelectionActivityTest Bug: 238559684 Bug: 238444812 Change-Id: I0be45f4b55be196f94034f6eb26657202d50e32f --- telephony/java/android/telephony/UiccSlotInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telephony/java/android/telephony/UiccSlotInfo.java b/telephony/java/android/telephony/UiccSlotInfo.java index 06c5b5cfeda11..5e02532e85a83 100644 --- a/telephony/java/android/telephony/UiccSlotInfo.java +++ b/telephony/java/android/telephony/UiccSlotInfo.java @@ -129,7 +129,7 @@ public class UiccSlotInfo implements Parcelable { this.mLogicalSlotIdx = logicalSlotIdx; this.mIsExtendedApduSupported = isExtendedApduSupported; this.mIsRemovable = false; - this.mPortList = null; + this.mPortList = new ArrayList(); } /**