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

Commit 717f52f2 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Intent to manage subscription plans.

Define an API for carrier apps to provide a deep-link into their app
for the user to see more details about their billing relationship,
such as upgrading plans.

The createManageSubscriptionIntent() method is ready for OS
components to use when deciding if they should show a "MANAGE"
button in their UI, and the returned Intent is fully constructed
and ready to roll.

Test: builds, boots
Bug: 64133169
Change-Id: I9b2775b7cba5313f517996870135eb4682082873
parent 60de82d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41194,7 +41194,7 @@ package android.telephony {
  public class SubscriptionManager {
    method public void addOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener);
    method public static android.telephony.SubscriptionManager from(android.content.Context);
    method public static deprecated android.telephony.SubscriptionManager from(android.content.Context);
    method public android.telephony.SubscriptionInfo getActiveSubscriptionInfo(int);
    method public int getActiveSubscriptionInfoCount();
    method public int getActiveSubscriptionInfoCountMax();
+1 −0
Original line number Diff line number Diff line
@@ -4171,6 +4171,7 @@ package android.telephony {
  public class SubscriptionManager {
    method public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
    method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>);
    field public static final java.lang.String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS";
  }

  public final class SubscriptionPlan implements android.os.Parcelable {
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ final class SystemServiceRegistry {
        registerService(Context.TELEPHONY_SUBSCRIPTION_SERVICE, SubscriptionManager.class,
                new CachedServiceFetcher<SubscriptionManager>() {
            @Override
            public SubscriptionManager createService(ContextImpl ctx) {
            public SubscriptionManager createService(ContextImpl ctx) throws ServiceNotFoundException {
                return new SubscriptionManager(ctx.getOuterContext());
            }});

+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ interface INetworkPolicyManager {

    SubscriptionPlan[] getSubscriptionPlans(int subId, String callingPackage);
    void setSubscriptionPlans(int subId, in SubscriptionPlan[] plans, String callingPackage);
    String getSubscriptionPlansOwner(int subId);

    void factoryReset(String subscriber);

+11 −0
Original line number Diff line number Diff line
@@ -2798,6 +2798,17 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
        }
    }

    @Override
    public String getSubscriptionPlansOwner(int subId) {
        if (UserHandle.getCallingAppId() != android.os.Process.SYSTEM_UID) {
            throw new SecurityException();
        }

        synchronized (mNetworkPoliciesSecondLock) {
            return mSubscriptionPlansOwner.get(subId);
        }
    }

    @Override
    protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
        if (!DumpUtils.checkDumpPermission(mContext, TAG, writer)) return;
Loading