Merge "5G opportunistic data config per-band."

This commit is contained in:
Meng Wang
2022-02-17 21:53:32 +00:00
committed by Gerrit Code Review

View File

@@ -3884,101 +3884,242 @@ public class CarrierConfigManager {
public static final String KEY_OPPORTUNISTIC_NETWORK_MAX_BACKOFF_TIME_LONG = public static final String KEY_OPPORTUNISTIC_NETWORK_MAX_BACKOFF_TIME_LONG =
"opportunistic_network_max_backoff_time_long"; "opportunistic_network_max_backoff_time_long";
/** /** @hide */
* Controls SS-RSRP threshold in dBm at which 5G opportunistic network will be considered good public static class OpportunisticNetwork {
* enough for internet data. /**
* * Prefix of all {@code OpportunisticNetwork.KEY_*} constants.
* @hide *
*/ * @hide
public static final String KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_SS_RSRP_INT = */
"opportunistic_network_entry_threshold_ss_rsrp_int"; public static final String PREFIX = "opportunistic.";
/** /**
* Controls SS-RSRQ threshold in dB at which 5G opportunistic network will be considered good * Controls SS-RSRP threshold in dBm at which 5G opportunistic network will be considered
* enough for internet data. * good enough for internet data. Note other factors may be considered for the final
* * decision.
* @hide *
*/ * <p>The value of {@link CellSignalStrengthNr#getSsRsrp} will be compared with this
public static final String KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE = * threshold.
"opportunistic_network_entry_threshold_ss_rsrq_double"; *
* @hide
*/
public static final String KEY_ENTRY_THRESHOLD_SS_RSRP_INT =
PREFIX + "entry_threshold_ss_rsrp_int";
/** /**
* Controls SS-RSRP threshold in dBm below which 5G opportunistic network available will not * Similar to {@link #KEY_ENTRY_THRESHOLD_SS_RSRP_INT} but supports different
* be considered good enough for internet data. * thresholds for different 5G bands. For bands not specified here, the threshold
* * will be {@link #KEY_ENTRY_THRESHOLD_SS_RSRP_INT}.
* @hide *
*/ * <p>For each key-value in the bundle: the key is the band number in string, which
public static final String KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_SS_RSRP_INT = * shall be a decimal integer as defined in {@code NgranBands.BAND_*} constants;
"opportunistic_network_exit_threshold_ss_rsrp_int"; * the value is the threshold in int.
*
* @hide
*/
public static final String KEY_ENTRY_THRESHOLD_SS_RSRP_INT_BUNDLE =
PREFIX + "entry_threshold_ss_rsrp_int_bundle";
/** /**
* Controls SS-RSRQ threshold in dB below which 5G opportunistic network available will not * Controls SS-RSRQ threshold in dB at which 5G opportunistic network will be considered
* be considered good enough for internet data. * good enough for internet data. Note other factors may be considered for the final
* * decision.
* @hide *
*/ * <p>The value of {@link CellSignalStrengthNr#getSsRsrq} will be compared with this
public static final String KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_SS_RSRQ_DOUBLE = * threshold.
"opportunistic_network_exit_threshold_ss_rsrq_double"; *
* @hide
*/
public static final String KEY_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE =
PREFIX + "entry_threshold_ss_rsrq_double";
/** /**
* Controls back off time in milliseconds for switching back to * Similar to {@link #KEY_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE} but supports different
* 5G opportunistic subscription. This time will be added to * thresholds for different 5G bands. For bands not specified here, the threshold
* {@link CarrierConfigManager#KEY_OPPORTUNISTIC_NETWORK_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG} to * will be {@link #KEY_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE}.
* determine hysteresis time if there is ping pong situation *
* (determined by system app or 1st party app) between primary and 5G opportunistic * <p>For each key-value in the bundle: the key is the band number in string, which
* subscription. Ping ping situation is defined in * shall be a decimal integer as defined in {@code NgranBands.BAND_*} constants;
* #KEY_OPPORTUNISTIC_NETWORK_5G_PING_PONG_TIME_LONG. * the value is the threshold in double.
* If ping pong situation continuous #KEY_OPPORTUNISTIC_5G_NETWORK_BACKOFF_TIME_LONG *
* will be added to previously determined hysteresis time. * @hide
* */
* @hide public static final String KEY_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE_BUNDLE =
*/ PREFIX + "entry_threshold_ss_rsrq_double_bundle";
public static final String KEY_OPPORTUNISTIC_NETWORK_5G_BACKOFF_TIME_LONG =
"opportunistic_network_5g_backoff_time_long";
/** /**
* Controls the max back off time in milliseconds for switching back to * Controls SS-RSRP threshold in dBm below which 5G opportunistic network available will not
* 5G opportunistic subscription. * be considered good enough for internet data. Note other factors may be considered
* This time will be the max hysteresis that can be determined irrespective of there is * for the final decision.
* continuous ping pong situation or not as described in *
* #KEY_OPPORTUNISTIC_NETWORK_5G_PING_PONG_TIME_LONG and * @hide
* #KEY_OPPORTUNISTIC_NETWORK_5G_BACKOFF_TIME_LONG. */
* public static final String KEY_EXIT_THRESHOLD_SS_RSRP_INT =
* @hide PREFIX + "exit_threshold_ss_rsrp_int";
*/
public static final String KEY_OPPORTUNISTIC_NETWORK_5G_MAX_BACKOFF_TIME_LONG =
"opportunistic_network_5g_max_backoff_time_long";
/** /**
* Controls the ping pong determination of 5G opportunistic network. * Similar to {@link #KEY_EXIT_THRESHOLD_SS_RSRP_INT} but supports different
* If opportunistic network is determined as out of service or below * thresholds for different 5G bands. For bands not specified here, the threshold
* #KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_SS_RSRP_INT or * will be {@link #KEY_EXIT_THRESHOLD_SS_RSRP_INT}.
* #KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_SS_RSRQ_INT within *
* #KEY_OPPORTUNISTIC_NETWORK_5G_PING_PONG_TIME_LONG of switching to opportunistic network, * <p>The syntax of its value is similar to
* it will be determined as ping pong situation by system app or 1st party app. * {@link #KEY_ENTRY_THRESHOLD_SS_RSRP_INT_BUNDLE}.
* *
* @hide * @hide
*/ */
public static final String KEY_OPPORTUNISTIC_NETWORK_5G_PING_PONG_TIME_LONG = public static final String KEY_EXIT_THRESHOLD_SS_RSRP_INT_BUNDLE =
"opportunistic_network_5g_ping_pong_time_long"; PREFIX + "exit_threshold_ss_rsrp_int_bundle";
/** /**
* Controls hysteresis time in milliseconds for which will be waited before switching * Controls SS-RSRQ threshold in dB below which 5G opportunistic network available will not
* data to a 5G opportunistic network. * be considered good enough for internet data. Note other factors may be considered
* * for the final decision.
* @hide *
*/ * @hide
public static final String KEY_OPPORTUNISTIC_NETWORK_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG = */
"opportunistic_network_5g_data_switch_hysteresis_time_long"; public static final String KEY_EXIT_THRESHOLD_SS_RSRQ_DOUBLE =
PREFIX + "exit_threshold_ss_rsrq_double";
/**
* Similar to {@link #KEY_EXIT_THRESHOLD_SS_RSRQ_DOUBLE} but supports different
* thresholds for different 5G bands. For bands not specified here, the threshold
* will be {@link #KEY_EXIT_THRESHOLD_SS_RSRQ_DOUBLE}.
*
* <p>The syntax of its value is similar to
* {@link #KEY_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE_BUNDLE}.
*
* @hide
*/
public static final String KEY_EXIT_THRESHOLD_SS_RSRQ_DOUBLE_BUNDLE =
PREFIX + "exit_threshold_ss_rsrq_double_bundle";
/**
* Controls hysteresis time in milliseconds for which will be waited before switching
* data to a 5G opportunistic network.
*
* @hide
*/
public static final String KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG =
PREFIX + "5g_data_switch_hysteresis_time_long";
/**
* Similar to {@link #KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG} but supports
* different values for different 5G bands. For bands not specified here, the threshold
* will be {@link #KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG}.
*
* <p>For each key-value in the bundle: the key is the band number in string, which
* shall be a decimal integer as defined in {@code NgranBands.BAND_*} constants;
* the value is the time in long.
*
* @hide
*/
public static final String KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG_BUNDLE =
PREFIX + "5g_data_switch_hysteresis_time_long_bundle";
/**
* Controls hysteresis time in milliseconds for which will be waited before switching from
* 5G opportunistic network to primary network.
*
* @hide
*/
public static final String KEY_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG =
PREFIX + "5g_data_switch_exit_hysteresis_time_long";
/**
* Similar to {@link #KEY_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG} but supports
* different values for different 5G bands. For bands not specified here, the threshold
* will be {@link #KEY_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG}.
*
* <p>The syntax is similar to
* {@link KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG_BUNDLE}.
*
* @hide
*/
public static final String KEY_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG_BUNDLE =
PREFIX + "5g_data_switch_exit_hysteresis_time_long_bundle";
/**
* Controls back off time in milliseconds for switching back to
* 5G opportunistic subscription. This time will be added to
* {@link #KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG} to
* determine hysteresis time if there is ping pong situation
* (determined by system app or 1st party app) between primary and 5G opportunistic
* subscription. Ping ping situation is defined in
* {@link #KEY_5G_PING_PONG_TIME_LONG}.
* If ping pong situation continuous {@link #KEY_5G_NETWORK_BACKOFF_TIME_LONG}
* will be added to previously determined hysteresis time.
*
* @hide
*/
public static final String KEY_5G_BACKOFF_TIME_LONG =
PREFIX + "5g_backoff_time_long";
/**
* Controls the max back off time in milliseconds for switching back to
* 5G opportunistic subscription.
* This time will be the max hysteresis that can be determined irrespective of there is
* continuous ping pong situation or not as described in
* {@link #KEY_5G_PING_PONG_TIME_LONG} and
* {@link #KEY_5G_BACKOFF_TIME_LONG}.
*
* @hide
*/
public static final String KEY_5G_MAX_BACKOFF_TIME_LONG =
PREFIX + "5g_max_backoff_time_long";
/**
* Controls the ping pong determination of 5G opportunistic network.
* If opportunistic network is determined as out of service or below
* {@link #KEY_EXIT_THRESHOLD_SS_RSRP_INT} or
* {@link #KEY_EXIT_THRESHOLD_SS_RSRQ_DOUBLE} within
* {@link #KEY_5G_PING_PONG_TIME_LONG} of switching to opportunistic network,
* it will be determined as ping pong situation by system app or 1st party app.
*
* @hide
*/
public static final String KEY_5G_PING_PONG_TIME_LONG =
PREFIX + "5g_ping_pong_time_long";
private static PersistableBundle getDefaults() {
PersistableBundle defaults = new PersistableBundle();
// Default value is -111 dBm for all bands.
sDefaults.putInt(KEY_ENTRY_THRESHOLD_SS_RSRP_INT, -111);
sDefaults.putPersistableBundle(KEY_ENTRY_THRESHOLD_SS_RSRP_INT_BUNDLE,
PersistableBundle.EMPTY);
// Default value is -18.5 dB for all bands.
sDefaults.putDouble(KEY_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE, -18.5);
sDefaults.putPersistableBundle(
KEY_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE_BUNDLE,
PersistableBundle.EMPTY);
// Default value is -120 dBm for all bands.
sDefaults.putInt(KEY_EXIT_THRESHOLD_SS_RSRP_INT, -120);
sDefaults.putPersistableBundle(KEY_EXIT_THRESHOLD_SS_RSRP_INT_BUNDLE,
PersistableBundle.EMPTY);
// Default value is -18.5 dB for all bands.
sDefaults.putDouble(KEY_EXIT_THRESHOLD_SS_RSRQ_DOUBLE, -18.5);
sDefaults.putPersistableBundle(
KEY_EXIT_THRESHOLD_SS_RSRQ_DOUBLE_BUNDLE,
PersistableBundle.EMPTY);
// Default value is 2 seconds for all bands.
defaults.putLong(KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG, 2000);
defaults.putPersistableBundle(
KEY_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG_BUNDLE,
PersistableBundle.EMPTY);
// Default value is 2 seconds for all bands.
defaults.putLong(KEY_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG, 2000);
defaults.putPersistableBundle(
KEY_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG_BUNDLE,
PersistableBundle.EMPTY);
// Default value is 10 seconds.
sDefaults.putLong(KEY_5G_BACKOFF_TIME_LONG, 10000);
// Default value is 60 seconds.
sDefaults.putLong(KEY_5G_MAX_BACKOFF_TIME_LONG, 60000);
// Default value is 60 seconds.
sDefaults.putLong(KEY_5G_PING_PONG_TIME_LONG, 60000);
return defaults;
}
}
/**
* Controls hysteresis time in milliseconds for which will be waited before switching from
* 5G opportunistic network to primary network.
*
* @hide
*/
public static final String KEY_OPPORTUNISTIC_NETWORK_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG =
"opportunistic_network_5g_data_switch_exit_hysteresis_time_long";
/** /**
* Controls whether 4G opportunistic networks should be scanned for possible data switch. * Controls whether 4G opportunistic networks should be scanned for possible data switch.
* *
@@ -6005,6 +6146,7 @@ public class CarrierConfigManager {
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_DATA_SWITCH_HYSTERESIS_TIME_LONG, 10000); sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_DATA_SWITCH_HYSTERESIS_TIME_LONG, 10000);
/* Default value is 3 seconds. */ /* Default value is 3 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG, 3000); sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG, 3000);
sDefaults.putAll(OpportunisticNetwork.getDefaults());
sDefaults.putBoolean(KEY_PING_TEST_BEFORE_DATA_SWITCH_BOOL, true); sDefaults.putBoolean(KEY_PING_TEST_BEFORE_DATA_SWITCH_BOOL, true);
sDefaults.putBoolean(KEY_SWITCH_DATA_TO_PRIMARY_IF_PRIMARY_IS_OOS_BOOL, true); sDefaults.putBoolean(KEY_SWITCH_DATA_TO_PRIMARY_IF_PRIMARY_IS_OOS_BOOL, true);
/* Default value is 60 seconds. */ /* Default value is 60 seconds. */
@@ -6013,24 +6155,6 @@ public class CarrierConfigManager {
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_BACKOFF_TIME_LONG, 10000); sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_BACKOFF_TIME_LONG, 10000);
/* Default value is 60 seconds. */ /* Default value is 60 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_MAX_BACKOFF_TIME_LONG, 60000); sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_MAX_BACKOFF_TIME_LONG, 60000);
/* Default value is -111 dBm. */
sDefaults.putInt(KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_SS_RSRP_INT, -111);
/* Default value is -18.5 dB. */
sDefaults.putDouble(KEY_OPPORTUNISTIC_NETWORK_ENTRY_THRESHOLD_SS_RSRQ_DOUBLE, -18.5);
/* Default value is -120 dBm. */
sDefaults.putInt(KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_SS_RSRP_INT, -120);
/* Default value is -18.5 dB. */
sDefaults.putDouble(KEY_OPPORTUNISTIC_NETWORK_EXIT_THRESHOLD_SS_RSRQ_DOUBLE, -18.5);
/* Default value is 10 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_5G_BACKOFF_TIME_LONG, 10000);
/* Default value is 60 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_5G_MAX_BACKOFF_TIME_LONG, 60000);
/* Default value is 60 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_5G_PING_PONG_TIME_LONG, 60000);
/* Default value is 2 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_5G_DATA_SWITCH_HYSTERESIS_TIME_LONG, 2000);
/* Default value is 2 seconds. */
sDefaults.putLong(KEY_OPPORTUNISTIC_NETWORK_5G_DATA_SWITCH_EXIT_HYSTERESIS_TIME_LONG, 2000);
sDefaults.putBoolean(KEY_ENABLE_4G_OPPORTUNISTIC_NETWORK_SCAN_BOOL, true); sDefaults.putBoolean(KEY_ENABLE_4G_OPPORTUNISTIC_NETWORK_SCAN_BOOL, true);
sDefaults.putLong(KEY_TIME_TO_SWITCH_BACK_TO_PRIMARY_IF_OPPORTUNISTIC_OOS_LONG, 60000L); sDefaults.putLong(KEY_TIME_TO_SWITCH_BACK_TO_PRIMARY_IF_OPPORTUNISTIC_OOS_LONG, 60000L);
sDefaults.putLong( sDefaults.putLong(