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

Commit eeb878fd authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Add setSubscriptionPlans() and getSubscriptionPlans() @SystemApi" am:...

Merge "Add setSubscriptionPlans() and getSubscriptionPlans() @SystemApi" am: 12aeaefe am: 5b9370b4

Change-Id: I01a9be9cc6263989cd2551940833a93f962c6450
parents 8d9d5c64 5b9370b4
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -4603,7 +4603,9 @@ package android.net {
  }
  }
  public class NetworkPolicyManager {
  public class NetworkPolicyManager {
    method @NonNull public android.telephony.SubscriptionPlan[] getSubscriptionPlans(int, @NonNull String);
    method public void setSubscriptionOverride(int, int, int, long, @NonNull String);
    method public void setSubscriptionOverride(int, int, int, long, @NonNull String);
    method public void setSubscriptionPlans(int, @NonNull android.telephony.SubscriptionPlan[], @NonNull String);
    field public static final int SUBSCRIPTION_OVERRIDE_CONGESTED = 2; // 0x2
    field public static final int SUBSCRIPTION_OVERRIDE_CONGESTED = 2; // 0x2
    field public static final int SUBSCRIPTION_OVERRIDE_UNMETERED = 1; // 0x1
    field public static final int SUBSCRIPTION_OVERRIDE_UNMETERED = 1; // 0x1
  }
  }
+31 −1
Original line number Original line Diff line number Diff line
@@ -337,7 +337,6 @@ public class NetworkPolicyManager {
     *            requested state until explicitly cleared, or the next reboot,
     *            requested state until explicitly cleared, or the next reboot,
     *            whichever happens first
     *            whichever happens first
     * @param callingPackage the name of the package making the call.
     * @param callingPackage the name of the package making the call.
     *
     */
     */
    public void setSubscriptionOverride(int subId, @SubscriptionOverrideMask int overrideMask,
    public void setSubscriptionOverride(int subId, @SubscriptionOverrideMask int overrideMask,
            @SubscriptionOverrideMask int overrideValue, long timeoutMillis,
            @SubscriptionOverrideMask int overrideValue, long timeoutMillis,
@@ -350,6 +349,37 @@ public class NetworkPolicyManager {
        }
        }
    }
    }


    /**
     * Set the subscription plans for a specific subscriber.
     *
     * @param subId the subscriber this relationship applies to.
     * @param plans the list of plans.
     * @param callingPackage the name of the package making the call
     */
    public void setSubscriptionPlans(int subId, @NonNull SubscriptionPlan[] plans,
            @NonNull String callingPackage) {
        try {
            mService.setSubscriptionPlans(subId, plans, callingPackage);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Get subscription plans for the given subscription id.
     *
     * @param subId the subscriber to get the subscription plans for.
     * @param callingPackage the name of the package making the call.
     */
    @NonNull
    public SubscriptionPlan[] getSubscriptionPlans(int subId, @NonNull String callingPackage) {
        try {
            return mService.getSubscriptionPlans(subId, callingPackage);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
    /**
     * Resets network policy settings back to factory defaults.
     * Resets network policy settings back to factory defaults.
     *
     *