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

Commit 53df1e44 authored by Shuo Qian's avatar Shuo Qian Committed by android-build-merger
Browse files

Merge "Explain the difference of isValid, isActive, isUsable" am: 9c649215 am: 614f1e0b

am: a2d4a163

Change-Id: I6f1632a89a5e66427938286bb1e96c63b8392ed9
parents 2b4acf22 a2d4a163
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -2009,21 +2009,27 @@ public class SubscriptionManager {
    }

    /**
     * Checks if the supplied subscription ID is valid.
     * Note: a valid subscription ID does not necessarily correspond to an active subscription.
     * Check if the supplied subscription ID is valid.
     *
     * <p>A valid subscription ID is not necessarily an active subscription ID
     * (see {@link #isActiveSubscriptionId(int)}) or an usable subscription ID
     * (see {@link #isUsableSubscriptionId(int)}). Unless specifically noted, subscription
     * APIs work with a valid subscription ID.
     *
     * @param subscriptionId The subscription ID.
     * @return true if the supplied subscriptionId is valid; false otherwise.
     * @return {@code true} if the supplied subscriptionId is valid; {@code false} otherwise.
     */
    public static boolean isValidSubscriptionId(int subscriptionId) {
        return subscriptionId > INVALID_SUBSCRIPTION_ID;
    }

    /**
     * Check if the subscription ID is usable.
     * Check if the supplied subscription ID is usable.
     *
     * A usable subscription ID has a valid value except some special values such as
     * {@link #DEFAULT_SUBSCRIPTION_ID}. It can be used for subscription functions.
     * <p>A usable subscription ID is a valid subscription ID, but not necessarily an active
     * subscription ID (see {@link #isActiveSubscriptionId(int)}). Some subscription APIs
     * require a usable subscription ID, and this is noted in their documentation; otherwise, a
     * subscription ID does not need to be usable for subscription functions, only valid.
     *
     * @param subscriptionId the subscription ID
     * @return {@code true} if the subscription ID is usable; {@code false} otherwise.
@@ -2281,7 +2287,8 @@ public class SubscriptionManager {
    }

    /**
     * Checks if the supplied subscription ID corresponds to an active subscription.
     * Checks if the supplied subscription ID corresponds to a subscription which is actively in
     * use on the device. An active subscription ID is a valid and usable subscription ID.
     *
     * @param subscriptionId the subscription ID.
     * @return {@code true} if the supplied subscription ID corresponds to an active subscription;