Loading core/java/android/telephony/SubscriptionPlan.java +12 −11 Original line number Diff line number Diff line Loading @@ -44,6 +44,14 @@ import java.util.Objects; * as explaining how much mobile data they have remaining, and what will happen * when they run out. * * If specifying network types, the developer must supply at least one plan * that applies to all network types (default), and all additional plans * may not include a particular network type more than once. * This is enforced by {@link SubscriptionManager} when setting the plans. * * Plan selection will prefer plans that have specific network types defined * over plans that apply to all network types. * * @see SubscriptionManager#setSubscriptionPlans(int, java.util.List) * @see SubscriptionManager#getSubscriptionPlans(int) */ Loading Loading @@ -213,7 +221,7 @@ public final class SubscriptionPlan implements Parcelable { /** * Return an array containing all {@link NetworkType}s this SubscriptionPlan applies to. * A null array means this SubscriptionPlan applies to all network types. * A null value means this SubscriptionPlan applies to all network types. */ public @Nullable @NetworkType int[] getNetworkTypes() { return networkTypes; Loading Loading @@ -372,20 +380,13 @@ public final class SubscriptionPlan implements Parcelable { /** * Set the network types this SubscriptionPlan applies to. * The developer must supply at least one plan that applies to all network types (default), * and all additional plans may not include a particular network type more than once. * Plan selection will prefer plans that have specific network types defined * over plans that apply to all network types. * * @param networkTypes a set of all {@link NetworkType}s that apply to this plan. * A null value or empty array means the plan applies to all network types. * A null value means the plan applies to all network types, * and an empty array means the plan applies to no network types. */ public @NonNull Builder setNetworkTypes(@Nullable @NetworkType int[] networkTypes) { if (networkTypes == null || networkTypes.length == 0) { plan.networkTypes = null; } else { plan.networkTypes = networkTypes; } return this; } } Loading telephony/java/android/telephony/SubscriptionManager.java +1 −3 Original line number Diff line number Diff line Loading @@ -2500,12 +2500,10 @@ public class SubscriptionManager { * @param plans the list of plans. The first plan is always the primary and * most important plan. Any additional plans are secondary and * may not be displayed or used by decision making logic. * The list of all plans must meet the requirements defined in * {@link SubscriptionPlan.Builder#setNetworkTypes(int[])}. * @throws SecurityException if the caller doesn't meet the requirements * outlined above. * @throws IllegalArgumentException if plans don't meet the requirements * mentioned above. * defined in {@link SubscriptionPlan}. */ public void setSubscriptionPlans(int subId, @NonNull List<SubscriptionPlan> plans) { try { Loading Loading
core/java/android/telephony/SubscriptionPlan.java +12 −11 Original line number Diff line number Diff line Loading @@ -44,6 +44,14 @@ import java.util.Objects; * as explaining how much mobile data they have remaining, and what will happen * when they run out. * * If specifying network types, the developer must supply at least one plan * that applies to all network types (default), and all additional plans * may not include a particular network type more than once. * This is enforced by {@link SubscriptionManager} when setting the plans. * * Plan selection will prefer plans that have specific network types defined * over plans that apply to all network types. * * @see SubscriptionManager#setSubscriptionPlans(int, java.util.List) * @see SubscriptionManager#getSubscriptionPlans(int) */ Loading Loading @@ -213,7 +221,7 @@ public final class SubscriptionPlan implements Parcelable { /** * Return an array containing all {@link NetworkType}s this SubscriptionPlan applies to. * A null array means this SubscriptionPlan applies to all network types. * A null value means this SubscriptionPlan applies to all network types. */ public @Nullable @NetworkType int[] getNetworkTypes() { return networkTypes; Loading Loading @@ -372,20 +380,13 @@ public final class SubscriptionPlan implements Parcelable { /** * Set the network types this SubscriptionPlan applies to. * The developer must supply at least one plan that applies to all network types (default), * and all additional plans may not include a particular network type more than once. * Plan selection will prefer plans that have specific network types defined * over plans that apply to all network types. * * @param networkTypes a set of all {@link NetworkType}s that apply to this plan. * A null value or empty array means the plan applies to all network types. * A null value means the plan applies to all network types, * and an empty array means the plan applies to no network types. */ public @NonNull Builder setNetworkTypes(@Nullable @NetworkType int[] networkTypes) { if (networkTypes == null || networkTypes.length == 0) { plan.networkTypes = null; } else { plan.networkTypes = networkTypes; } return this; } } Loading
telephony/java/android/telephony/SubscriptionManager.java +1 −3 Original line number Diff line number Diff line Loading @@ -2500,12 +2500,10 @@ public class SubscriptionManager { * @param plans the list of plans. The first plan is always the primary and * most important plan. Any additional plans are secondary and * may not be displayed or used by decision making logic. * The list of all plans must meet the requirements defined in * {@link SubscriptionPlan.Builder#setNetworkTypes(int[])}. * @throws SecurityException if the caller doesn't meet the requirements * outlined above. * @throws IllegalArgumentException if plans don't meet the requirements * mentioned above. * defined in {@link SubscriptionPlan}. */ public void setSubscriptionPlans(int subId, @NonNull List<SubscriptionPlan> plans) { try { Loading