Merge "Fix null pointer in SubscriptionUtil" into qt-dev
am: 30d0e6c7d7
Change-Id: I0cba2206822450f14610d557f7844e8e1ea08abc
This commit is contained in:
@@ -59,7 +59,11 @@ public class SubscriptionUtil {
|
||||
return subscriptions;
|
||||
}
|
||||
|
||||
private static boolean isInactiveInsertedPSim(UiccSlotInfo slotInfo) {
|
||||
@VisibleForTesting
|
||||
static boolean isInactiveInsertedPSim(UiccSlotInfo slotInfo) {
|
||||
if (slotInfo == null) {
|
||||
return false;
|
||||
}
|
||||
return !slotInfo.getIsEuicc() && !slotInfo.getIsActive() &&
|
||||
slotInfo.getCardStateInfo() == CARD_STATE_INFO_PRESENT;
|
||||
}
|
||||
|
@@ -187,4 +187,9 @@ public class SubscriptionUtilTest {
|
||||
assertThat(subs).isNotNull();
|
||||
assertThat(subs).hasSize(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isInactiveInsertedPSim_nullSubInfo_doesNotCrash() {
|
||||
assertThat(SubscriptionUtil.isInactiveInsertedPSim(null)).isFalse();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user