diff options
| -rw-r--r-- | core/res/res/values/config_telephony.xml | 9 | ||||
| -rw-r--r-- | telephony/java/android/telephony/CarrierConfigManager.java | 66 |
2 files changed, 75 insertions, 0 deletions
diff --git a/core/res/res/values/config_telephony.xml b/core/res/res/values/config_telephony.xml index 4ae54a052859..08c40ba0e823 100644 --- a/core/res/res/values/config_telephony.xml +++ b/core/res/res/values/config_telephony.xml @@ -67,6 +67,15 @@ <bool name="auto_data_switch_ping_test_before_switch">true</bool> <java-symbol type="bool" name="auto_data_switch_ping_test_before_switch" /> + <!-- Define the tolerated gap of score for auto data switch decision, larger than which the + device will switch to the SIM with higher score. The score is used in conjunction with the + score table defined in + CarrierConfigManager#KEY_AUTO_DATA_SWITCH_RAT_SIGNAL_SCORE_STRING_ARRAY. + If 0, the device always switch to the higher score SIM. + If < 0, the network type and signal strength based auto switch is disabled. --> + <integer name="auto_data_switch_score_tolerance">3000</integer> + <java-symbol type="integer" name="auto_data_switch_score_tolerance" /> + <!-- Boolean indicating whether the Iwlan data service supports persistence of iwlan ipsec tunnels across service restart. If iwlan tunnels are not persisted across restart, Framework will clean up dangling data connections when service restarts --> diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 5b1c6b1c88b8..5b946e8540d1 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -9730,6 +9730,27 @@ public class CarrierConfigManager { public static final String KEY_IWLAN_HANDOVER_POLICY_STRING_ARRAY = "iwlan_handover_policy_string_array"; + /** + * Score table for {@link TelephonyManager#MOBILE_DATA_POLICY_AUTO_DATA_SWITCH}. The score is + * used in conjunction with a tolerance value defined in resource config + * {@code auto_data_switch_score_tolerance}, greater than which device will switch to the sub + * with higher score. + * Possible keys are network type name string(also see {@link #KEY_BANDWIDTH_STRING_ARRAY}). + * Value should be "score_level_0, score_level_1, score_level_2, score_level_3,score_level_4". + * Each network type must have 5 scores correspond to {@link CellSignalStrength}, where score is + * a non-negative integer. A score of 0 is treated the same as data out of service. + * + * For NR (5G), the following network names should be used: + * - NR_NSA: NR NSA, sub-6 frequencies + * - NR_NSA_MMWAVE: NR NSA, mmwave frequencies + * - NR_SA: NR SA, sub-6 frequencies + * - NR_SA_MMWAVE: NR SA, mmwave frequencies + * + * @hide + */ + public static final String KEY_AUTO_DATA_SWITCH_RAT_SIGNAL_SCORE_BUNDLE = + "auto_data_switch_rat_signal_score_string_bundle"; + /** The default value for every variable. */ private static final PersistableBundle sDefaults; @@ -10404,6 +10425,51 @@ public class CarrierConfigManager { sDefaults.putStringArray(KEY_IWLAN_HANDOVER_POLICY_STRING_ARRAY, new String[]{ "source=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN, " + "target=GERAN|UTRAN|EUTRAN|NGRAN|IWLAN, type=allowed"}); + PersistableBundle auto_data_switch_rat_signal_score_string_bundle = new PersistableBundle(); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "NR_SA_MMWAVE", new int[]{10000, 13227, 16000, 18488, 20017}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "NR_NSA_MMWAVE", new int[]{8000, 10227, 12488, 15017, 15278}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "LTE", new int[]{3731, 5965, 8618, 11179, 13384}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "NR_SA", new int[]{5288, 6795, 6955, 7562, 9713}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "NR_NSA", new int[]{5463, 6827, 8029, 9007, 9428}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "UMTS", new int[]{100, 169, 183, 192, 300}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "eHRPD", new int[]{10, 400, 600, 800, 1000}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "TD_SCDMA", new int[]{1, 100, 500, 1000}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "iDEN", new int[]{1, 2, 10, 50, 100}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "EvDo_B", new int[]{1000, 1495, 2186, 2532, 2600}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "HSPA+", new int[]{1619, 2500, 3393, 4129, 4212}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "HSPA", new int[]{1000, 1495, 2186, 2532, 2544}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "HSUPA", new int[]{1500, 1919, 2132, 2362, 2704}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "HSDPA", new int[]{1500, 1732, 4000, 7000, 8000}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "EvDo_A", new int[]{600, 840, 1200, 1300, 1400}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "EvDo_0", new int[]{300, 600, 1000, 1500, 2000}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "1xRTT", new int[]{50, 60, 70, 80}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "EDGE", new int[]{154, 169, 183, 192, 267}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "GPRS", new int[]{15, 30, 40, 45, 50}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "CDMA", new int[]{1, 50, 100, 300, 2000}); + auto_data_switch_rat_signal_score_string_bundle.putIntArray( + "GSM", new int[]{1, 2, 10, 50, 100}); + sDefaults.putPersistableBundle(KEY_AUTO_DATA_SWITCH_RAT_SIGNAL_SCORE_BUNDLE, + auto_data_switch_rat_signal_score_string_bundle); sDefaults.putInt(KEY_CELLULAR_USAGE_SETTING_INT, SubscriptionManager.USAGE_SETTING_UNKNOWN); // Default data stall recovery configurations. |