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
diff --git a/telephony/java/android/telephony/UiccSlotInfo.java b/telephony/java/android/telephony/UiccSlotInfo.java
index 06c5b5c..5e02532 100644
--- a/telephony/java/android/telephony/UiccSlotInfo.java
+++ b/telephony/java/android/telephony/UiccSlotInfo.java
@@ -129,7 +129,7 @@
this.mLogicalSlotIdx = logicalSlotIdx;
this.mIsExtendedApduSupported = isExtendedApduSupported;
this.mIsRemovable = false;
- this.mPortList = null;
+ this.mPortList = new ArrayList<UiccPortInfo>();
}
/**