From ffc4b56cfa9bdac22d2ed15c347549504e59a963 Mon Sep 17 00:00:00 2001 From: Ling Ma Date: Wed, 14 Sep 2022 20:34:17 -0700 Subject: [PATCH] Add MOBILE_DATA_POLICY_AUTO_DATA_SWITCH The feature only applies to non-DDS. If enabled, we automatically switch to the non-DDS for data traffic when it has better availability than the DDS. Test: cts Bug: 258510998 Change-Id: Id827b3e253b637273504d87c8db64893c7b70924 Merged-In: Id827b3e253b637273504d87c8db64893c7b70924 (cherry picked from commit 837daa5cd133b29f819bc18e5a68fc2779e49d30) --- .../android/telephony/TelephonyManager.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index b6f86527b7477..105fc4c38c132 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -15379,12 +15379,29 @@ public class TelephonyManager { @SystemApi public static final int MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED = 2; + /** + * Allow switching mobile data to the non-default SIM if the non-default SIM has better + * availability. + * + * This is used for temporarily allowing data on the non-default data SIM when on-default SIM + * has better availability on DSDS devices, where better availability means strong + * signal/connectivity. + * If this policy is enabled, data will be temporarily enabled on the non-default data SIM, + * including during any voice calls(equivalent to enabling + * {@link #MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL}). + * + * This policy can be enabled and disabled via {@link #setMobileDataPolicyEnabled}. + * @hide + */ + public static final int MOBILE_DATA_POLICY_AUTO_DATA_SWITCH = 3; + /** * @hide */ @IntDef(prefix = { "MOBILE_DATA_POLICY_" }, value = { MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL, MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED, + MOBILE_DATA_POLICY_AUTO_DATA_SWITCH, }) @Retention(RetentionPolicy.SOURCE) public @interface MobileDataPolicy { }