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

Commit b4379557 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am af23987e: Merge "Add SM isUsableSubIdValue" into lmp-sprout-dev

* commit 'af23987e8d704f6436984661536af293712e4467':
  Add SM isUsableSubIdValue
parents 0dc92f3a 3bb63f42
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -65,6 +65,15 @@ public class SubscriptionManager implements BaseColumns {
    /** Indicates the caller wants the default sub id. */
    public static final long DEFAULT_SUB_ID = Long.MAX_VALUE;

    /** Minimum possible subid that represents a subscription */
    /** @hide */
    public static final long MIN_SUB_ID_VALUE = 0;

    /** Maximum possible subid that represents a subscription */
    /** @hide */
    public static final long MAX_SUB_ID_VALUE = DEFAULT_SUB_ID - 1;


    /** @hide */
    public static final Uri CONTENT_URI = Uri.parse("content://telephony/siminfo");

@@ -914,6 +923,15 @@ public class SubscriptionManager implements BaseColumns {
        return subId > INVALID_SUB_ID ;
    }

    /**
     * @return true if subId is an usable subId value else false. A
     * usable subId means its neither a INVALID_SUB_ID nor a DEFAUL_SUB_ID.
     * @hide
     */
    public static boolean isUsableSubIdValue(long subId) {
        return subId >= MIN_SUB_ID_VALUE && subId <= MAX_SUB_ID_VALUE;
    }

    /** @hide */
    public static boolean isValidSlotId(int slotId) {
        // We are testing INVALID_SLOT_ID and slotId >= 0 independently because we should