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

Commit a012db21 authored by Jack Yu's avatar Jack Yu Committed by Gerrit Code Review
Browse files

Merge "Removed the obsolete code" into main

parents 183da587 0898f955
Loading
Loading
Loading
Loading
+16 −30
Original line number Diff line number Diff line
@@ -3628,17 +3628,10 @@ public class SubscriptionManager {
    }

    /**
     * Enables or disables a subscription. This is currently used in the settings page. It will
     * fail and return false if operation is not supported or failed.
     * Enable or disable a subscription. This method is same as
     * {@link #setUiccApplicationsEnabled(int, boolean)}.
     *
     * To disable an active subscription on a physical (non-Euicc) SIM,
     * {@link #canDisablePhysicalSubscription} needs to be true.
     *
     * <p>
     * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
     *
     * @param subscriptionId Subscription to be enabled or disabled. It could be a eSIM or pSIM
     * subscription.
     * @param subscriptionId Subscription to be enabled or disabled.
     * @param enable whether user is turning it on or off.
     *
     * @return whether the operation is successful.
@@ -3648,20 +3641,16 @@ public class SubscriptionManager {
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public boolean setSubscriptionEnabled(int subscriptionId, boolean enable) {
        if (VDBG) {
            logd("setSubscriptionActivated subId= " + subscriptionId + " enable " + enable);
        }
        try {
            ISub iSub = TelephonyManager.getSubscriptionService();
            if (iSub != null) {
                return iSub.setSubscriptionEnabled(enable, subscriptionId);
                iSub.setUiccApplicationsEnabled(enable, subscriptionId);
            }
        } catch (RemoteException ex) {
            // ignore it
        }

            return false;
        }
        return true;
    }

    /**
     * Set uicc applications being enabled or disabled.
@@ -3683,11 +3672,7 @@ public class SubscriptionManager {
            logd("setUiccApplicationsEnabled subId= " + subscriptionId + " enable " + enabled);
        }
        try {
            ISub iSub = ISub.Stub.asInterface(
                    TelephonyFrameworkInitializer
                            .getTelephonyServiceManager()
                            .getSubscriptionServiceRegisterer()
                            .get());
            ISub iSub = TelephonyManager.getSubscriptionService();
            if (iSub != null) {
                iSub.setUiccApplicationsEnabled(enabled, subscriptionId);
            }
@@ -3715,11 +3700,7 @@ public class SubscriptionManager {
            logd("canDisablePhysicalSubscription");
        }
        try {
            ISub iSub = ISub.Stub.asInterface(
                    TelephonyFrameworkInitializer
                            .getTelephonyServiceManager()
                            .getSubscriptionServiceRegisterer()
                            .get());
            ISub iSub = TelephonyManager.getSubscriptionService();
            if (iSub != null) {
                return iSub.canDisablePhysicalSubscription();
            }
@@ -3843,10 +3824,15 @@ public class SubscriptionManager {
    }

    /**
     * DO NOT USE.
     * This API is designed for features that are not finished at this point. Do not call this API.
     * Get the active subscription id by logical SIM slot index.
     *
     * @param slotIndex The logical SIM slot index.
     * @return The active subscription id.
     *
     * @throws IllegalArgumentException if the provided slot index is invalid.
     * @throws SecurityException if callers do not hold the required permission.
     *
     * @hide
     * TODO b/135547512: further clean up
     */
    @SystemApi
    @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
+1 −3
Original line number Diff line number Diff line
@@ -265,8 +265,6 @@ interface ISub {
    String getSubscriptionProperty(int subId, String propKey, String callingPackage,
            String callingFeatureId);

    boolean setSubscriptionEnabled(boolean enable, int subId);

    boolean isSubscriptionEnabled(int subId);

    int getEnabledSubscriptionId(int slotIndex);
@@ -277,7 +275,7 @@ interface ISub {

    boolean canDisablePhysicalSubscription();

    int setUiccApplicationsEnabled(boolean enabled, int subscriptionId);
    void setUiccApplicationsEnabled(boolean enabled, int subscriptionId);

    int setDeviceToDeviceStatusSharing(int sharing, int subId);