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

Commit 6f87ad9a authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "[Mainline] Move the setAlwaysAllowMmsData from SubscriptionManager to...

Merge "[Mainline] Move the setAlwaysAllowMmsData from SubscriptionManager to TelephonyManager" am: 442a1ca0

Change-Id: I2b518c3bc87d2ae3db242227532c5306522e0ab7
parents d6e6068d 442a1ca0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9613,6 +9613,7 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings();
    method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAllowedNetworkTypes(long);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setAlwaysAllowMmsData(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAlwaysReportSignalStrength(boolean);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setCallForwarding(@NonNull android.telephony.CallForwardingInfo);
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setCallWaitingStatus(boolean);
+0 −25
Original line number Diff line number Diff line
@@ -3275,31 +3275,6 @@ public class SubscriptionManager {
        return subId;
    }

    /**
     * Set whether a subscription always allows MMS connection. If true, MMS network
     * request will be accepted by telephony even if user turns "mobile data" off
     * on this subscription.
     *
     * @param subId which subscription it's setting to.
     * @param alwaysAllow whether Mms data is always allowed.
     * @return whether operation is successful.
     *
     * @hide
     */
    public boolean setAlwaysAllowMmsData(int subId, boolean alwaysAllow) {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
                return iSub.setAlwaysAllowMmsData(subId, alwaysAllow);
            }
        } catch (RemoteException ex) {
            if (!isSystemProcess()) {
                ex.rethrowAsRuntimeException();
            }
        }
        return false;
    }

    private interface CallISubMethodHelper {
        int callMethod(ISub iSub) throws RemoteException;
    }
+27 −1
Original line number Diff line number Diff line
@@ -12128,7 +12128,7 @@ public class TelephonyManager {
     *  1) User data is turned on, or
     *  2) APN is un-metered for this subscription, or
     *  3) APN type is whitelisted. E.g. MMS is whitelisted if
     *  {@link SubscriptionManager#setAlwaysAllowMmsData} is turned on.
     *  {@link #setAlwaysAllowMmsData(boolean)} is turned on.
     *
     * @param apnType Value indicating the apn type. Apn types are defined in {@link ApnSetting}.
     * @return whether data is enabled for a apn type.
@@ -12435,4 +12435,30 @@ public class TelephonyManager {
        }
        return false;
    }

    /**
     * Set whether the specific sim card always allows MMS connection. If true, MMS network
     * request will be accepted by telephony even if user turns "mobile data" off
     * on this specific sim card.
     *
     * @param alwaysAllow whether Mms data is always allowed.
     * @return whether operation is successful.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public boolean setAlwaysAllowMmsData(boolean alwaysAllow) {
        try {
            ITelephony service = getITelephony();
            if (service != null) {
                return service.setAlwaysAllowMmsData(getSubId(), alwaysAllow);
            }
        } catch (RemoteException ex) {
            if (!isSystemProcess()) {
                ex.rethrowAsRuntimeException();
            }
        }
        return false;
    }
}
+0 −2
Original line number Diff line number Diff line
@@ -295,8 +295,6 @@ interface ISub {

    boolean isActiveSubId(int subId, String callingPackage, String callingFeatureId);

    boolean setAlwaysAllowMmsData(int subId, boolean alwaysAllow);

    int getActiveDataSubscriptionId();

    boolean canDisablePhysicalSubscription();
+5 −0
Original line number Diff line number Diff line
@@ -2240,6 +2240,11 @@ interface ITelephony {
     */
    boolean isDataAllowedInVoiceCall(int subId);

    /**
     * Set whether a subscription always allows MMS connection.
     */
    boolean setAlwaysAllowMmsData(int subId, boolean allow);

    /**
     * Command line command to enable or disable handling of CEP data for test purposes.
     */