diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 0808adf26aef7..d4f98743089ec 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -293,6 +293,19 @@ public class SubscriptionManager { /** @hide */ public static final String SUBSCRIPTION_TYPE = "subscription_type"; + /** + * TelephonyProvider column name white_listed_apn_data. + * It's a bitmask of APN types that will be allowed on this subscription even if it's metered + * and mobile data is turned off by the user. + *
Type: INTEGER (int)
For example, if TYPE_MMS is is true, Telephony will allow MMS + * data connection to setup even if MMS is metered and mobile_data is turned off on that + * subscription. + * + * Default value is 0. + */ + /** @hide */ + public static final String WHITE_LISTED_APN_DATA = "white_listed_apn_data"; + /** * This constant is to designate a subscription as a Local-SIM Subscription. * A Local-SIM can be a physical SIM inserted into a sim-slot in the device, or eSIM on the
@@ -3086,6 +3099,31 @@ 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;
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 2bd4f8f336fd7..18b9fbbf414e2 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -10948,4 +10948,33 @@ public class TelephonyManager {
}
return new Pair