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
This commit is contained in:
Michael Hoisie
2022-07-10 21:46:54 +00:00
parent f6aac7b589
commit 02cc3745cb

View File

@@ -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<UiccPortInfo>();
}
/**