diff options
| author | Sarah Chin <sarahchin@google.com> | 2022-03-21 15:55:45 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-03-21 15:55:45 +0000 |
| commit | 0bf5d391741b7d40f27d40d8ac18153497a51789 (patch) | |
| tree | adfc5320e970b32d84c734d4fa01f4bb916e9d23 /core/java | |
| parent | b96f60f5c3a1dede178da36986001a516473643b (diff) | |
| parent | 1ef011e51084bd0bac600ec914510be2773ce912 (diff) | |
Merge "Ensure SubscriptionPlans can be removed"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/INetworkPolicyManager.aidl | 4 | ||||
| -rw-r--r-- | core/java/android/net/NetworkPolicyManager.java | 15 |
2 files changed, 11 insertions, 8 deletions
diff --git a/core/java/android/net/INetworkPolicyManager.aidl b/core/java/android/net/INetworkPolicyManager.aidl index 6284f56c8258..dc241066a60a 100644 --- a/core/java/android/net/INetworkPolicyManager.aidl +++ b/core/java/android/net/INetworkPolicyManager.aidl @@ -72,9 +72,9 @@ interface INetworkPolicyManager { SubscriptionPlan getSubscriptionPlan(in NetworkTemplate template); void notifyStatsProviderWarningOrLimitReached(); SubscriptionPlan[] getSubscriptionPlans(int subId, String callingPackage); - void setSubscriptionPlans(int subId, in SubscriptionPlan[] plans, String callingPackage); + void setSubscriptionPlans(int subId, in SubscriptionPlan[] plans, long expirationDurationMillis, String callingPackage); String getSubscriptionPlansOwner(int subId); - void setSubscriptionOverride(int subId, int overrideMask, int overrideValue, in int[] networkTypes, long timeoutMillis, String callingPackage); + void setSubscriptionOverride(int subId, int overrideMask, int overrideValue, in int[] networkTypes, long expirationDurationMillis, String callingPackage); void factoryReset(String subscriber); diff --git a/core/java/android/net/NetworkPolicyManager.java b/core/java/android/net/NetworkPolicyManager.java index 3f92eb1d9a40..43ae4fc0a41b 100644 --- a/core/java/android/net/NetworkPolicyManager.java +++ b/core/java/android/net/NetworkPolicyManager.java @@ -484,8 +484,8 @@ public class NetworkPolicyManager { * @param networkTypes the network types this override applies to. If no * network types are specified, override values will be ignored. * {@see TelephonyManager#getAllNetworkTypes()} - * @param timeoutMillis the timeout after which the requested override will - * be automatically cleared, or {@code 0} to leave in the + * @param expirationDurationMillis the duration after which the requested override + * will be automatically cleared, or {@code 0} to leave in the * requested state until explicitly cleared, or the next reboot, * whichever happens first * @param callingPackage the name of the package making the call. @@ -493,11 +493,11 @@ public class NetworkPolicyManager { */ public void setSubscriptionOverride(int subId, @SubscriptionOverrideMask int overrideMask, @SubscriptionOverrideMask int overrideValue, - @NonNull @Annotation.NetworkType int[] networkTypes, long timeoutMillis, + @NonNull @Annotation.NetworkType int[] networkTypes, long expirationDurationMillis, @NonNull String callingPackage) { try { mService.setSubscriptionOverride(subId, overrideMask, overrideValue, networkTypes, - timeoutMillis, callingPackage); + expirationDurationMillis, callingPackage); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -508,13 +508,16 @@ public class NetworkPolicyManager { * * @param subId the subscriber this relationship applies to. * @param plans the list of plans. + * @param expirationDurationMillis the duration after which the subscription plans + * will be automatically cleared, or {@code 0} to leave the plans until + * explicitly cleared, or the next reboot, whichever happens first * @param callingPackage the name of the package making the call * @hide */ public void setSubscriptionPlans(int subId, @NonNull SubscriptionPlan[] plans, - @NonNull String callingPackage) { + long expirationDurationMillis, @NonNull String callingPackage) { try { - mService.setSubscriptionPlans(subId, plans, callingPackage); + mService.setSubscriptionPlans(subId, plans, expirationDurationMillis, callingPackage); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } |
