Add method to reset network types

Test: build
Bug: 148218045
Change-Id: Ia6eaba4e40fe47e79f8a7b6bcbadc61151d84823
Merged-In: Ia6eaba4e40fe47e79f8a7b6bcbadc61151d84823
This commit is contained in:
Sarah Chin 2020-03-20 10:51:29 -07:00
parent f0697914ca
commit bab3e662df
2 changed files with 11 additions and 0 deletions

View File

@ -45880,6 +45880,7 @@ package android.telephony {
method public android.telephony.SubscriptionPlan build();
method public static android.telephony.SubscriptionPlan.Builder createNonrecurring(java.time.ZonedDateTime, java.time.ZonedDateTime);
method public static android.telephony.SubscriptionPlan.Builder createRecurring(java.time.ZonedDateTime, java.time.Period);
method @NonNull public android.telephony.SubscriptionPlan.Builder resetNetworkTypes();
method public android.telephony.SubscriptionPlan.Builder setDataLimit(long, int);
method public android.telephony.SubscriptionPlan.Builder setDataUsage(long, long);
method @NonNull public android.telephony.SubscriptionPlan.Builder setNetworkTypes(@NonNull int[]);

View File

@ -372,5 +372,15 @@ public final class SubscriptionPlan implements Parcelable {
plan.networkTypes = Arrays.copyOf(networkTypes, networkTypes.length);
return this;
}
/**
* Reset any network types that were set with {@link #setNetworkTypes(int[])}.
* This will make the SubscriptionPlan apply to all network types.
*/
public @NonNull Builder resetNetworkTypes() {
plan.networkTypes = Arrays.copyOf(TelephonyManager.getAllNetworkTypes(),
TelephonyManager.getAllNetworkTypes().length);
return this;
}
}
}