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

Change-Id: I2b518c3bc87d2ae3db242227532c5306522e0ab7
This commit is contained in:
Automerger Merge Worker
2020-02-04 02:55:32 +00:00
5 changed files with 33 additions and 28 deletions

View File

@@ -9613,6 +9613,7 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) public void resetSettings(); 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 @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 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 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 setCallForwarding(@NonNull android.telephony.CallForwardingInfo);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setCallWaitingStatus(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setCallWaitingStatus(boolean);

View File

@@ -3275,31 +3275,6 @@ public class SubscriptionManager {
return subId; 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 { private interface CallISubMethodHelper {
int callMethod(ISub iSub) throws RemoteException; int callMethod(ISub iSub) throws RemoteException;
} }

View File

@@ -12128,7 +12128,7 @@ public class TelephonyManager {
* 1) User data is turned on, or * 1) User data is turned on, or
* 2) APN is un-metered for this subscription, or * 2) APN is un-metered for this subscription, or
* 3) APN type is whitelisted. E.g. MMS is whitelisted if * 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}. * @param apnType Value indicating the apn type. Apn types are defined in {@link ApnSetting}.
* @return whether data is enabled for a apn type. * @return whether data is enabled for a apn type.
@@ -12435,4 +12435,30 @@ public class TelephonyManager {
} }
return false; 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;
}
} }

View File

@@ -295,8 +295,6 @@ interface ISub {
boolean isActiveSubId(int subId, String callingPackage, String callingFeatureId); boolean isActiveSubId(int subId, String callingPackage, String callingFeatureId);
boolean setAlwaysAllowMmsData(int subId, boolean alwaysAllow);
int getActiveDataSubscriptionId(); int getActiveDataSubscriptionId();
boolean canDisablePhysicalSubscription(); boolean canDisablePhysicalSubscription();

View File

@@ -2240,6 +2240,11 @@ interface ITelephony {
*/ */
boolean isDataAllowedInVoiceCall(int subId); 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. * Command line command to enable or disable handling of CEP data for test purposes.
*/ */