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

Commit a43e23fb authored by Malcolm Chen's avatar Malcolm Chen Committed by Jack Yu
Browse files

Have isValidPhoneId and isValidSlotIndex based on activeModemCount.

Bug: 142514392
Test: sanity and unittest
Merged-In: Ia66ee24151d1ec8ecde2dcb4c824a19b4d2cd172
Change-Id: Ia66ee24151d1ec8ecde2dcb4c824a19b4d2cd172
(cherry picked from commit dde04f8f)
parent 5d6eea1b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2101,13 +2101,13 @@ public class SubscriptionManager {
    /** @hide */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    public static boolean isValidSlotIndex(int slotIndex) {
        return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getSupportedModemCount();
        return slotIndex >= 0 && slotIndex < TelephonyManager.getDefault().getActiveModemCount();
    }

    /** @hide */
    @UnsupportedAppUsage
    public static boolean isValidPhoneId(int phoneId) {
        return phoneId >= 0 && phoneId < TelephonyManager.getDefault().getSupportedModemCount();
        return phoneId >= 0 && phoneId < TelephonyManager.getDefault().getActiveModemCount();
    }

    /** @hide */