Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30d0e6c7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix null pointer in SubscriptionUtil" into qt-dev

parents d07911b0 b5d471c1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;
    }
+5 −0
Original line number Diff line number Diff line
@@ -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();
    }
}