From 98f42108b334a2a5c68ecccff6841eab0be1601d Mon Sep 17 00:00:00 2001 From: rambowang Date: Mon, 26 Sep 2022 19:07:51 -0500 Subject: [PATCH] Expose KEY_DATA_SWITCH_VALIDATION_MIN_INTERVAL_MILLIS_LONG as public API Rename from KEY_DATA_SWITCH_VALIDATION_MIN_GAP_LONG to follow the canonical naming format. Expose as public API to avoid clients depending on hide API. The carrier config has been introduced since Android QT release and is stable for now. Carriers like GoogleFi has overridden the carrier config to take advantage of the feature for years. A renamed carrier config key which aliases old key but shares old value is created to rename the carrier config and keep the maximum backward compatibility. Bug: 181813215 Test: m -j offline-sdk-docs Change-Id: Ibc60b1872c9d1c3db0e4f42776a2616339154370 --- core/api/current.txt | 1 + .../telephony/CarrierConfigManager.java | 24 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/core/api/current.txt b/core/api/current.txt index 27d5ac3efa425..3f6991379c8d5 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -41553,6 +41553,7 @@ package android.telephony { field public static final String KEY_DATA_LIMIT_NOTIFICATION_BOOL = "data_limit_notification_bool"; field public static final String KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG = "data_limit_threshold_bytes_long"; field public static final String KEY_DATA_RAPID_NOTIFICATION_BOOL = "data_rapid_notification_bool"; + field public static final String KEY_DATA_SWITCH_VALIDATION_MIN_INTERVAL_MILLIS_LONG = "data_switch_validation_min_gap_long"; field public static final String KEY_DATA_SWITCH_VALIDATION_TIMEOUT_LONG = "data_switch_validation_timeout_long"; field public static final String KEY_DATA_WARNING_NOTIFICATION_BOOL = "data_warning_notification_bool"; field public static final String KEY_DATA_WARNING_THRESHOLD_BYTES_LONG = "data_warning_threshold_bytes_long"; diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 2a1efed63dd29..fa7b10f3f058b 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -4825,10 +4825,31 @@ public class CarrierConfigManager { * The max acceptable value of this config is 24 hours. * * @hide + * @deprecated Use {@link #KEY_DATA_SWITCH_VALIDATION_MIN_INTERVAL_MILLIS_LONG} instead. */ + @Deprecated public static final String KEY_DATA_SWITCH_VALIDATION_MIN_GAP_LONG = "data_switch_validation_min_gap_long"; + /** + * Data switch validation minimal interval, in milliseconds. + * + * If a connection to the default (Internet) PDN for the current subscription is validated on + * a given operator within a given tracking area, re-validations to that matching operator will + * be skipped if they would occur within the specified interval. Instead, the connection will + * automatically considered validated. + * + * If the network was validated within the interval but the latest validation result was false, + * the validation will not be skipped. If not set or set to 0, validation will not be skipped. + * + * The valid range of value is between 0 millisecond and 24 hours, inclusive in both sides. The + * default value is 24 hours. + * + * @see android.net.NetworkCapabilities#NET_CAPABILITY_VALIDATED + */ + public static final String KEY_DATA_SWITCH_VALIDATION_MIN_INTERVAL_MILLIS_LONG = + KEY_DATA_SWITCH_VALIDATION_MIN_GAP_LONG; + /** * A boolean property indicating whether this subscription should be managed as an opportunistic * subscription. @@ -9331,7 +9352,8 @@ public class CarrierConfigManager { sDefaults.putInt(KEY_GBA_UA_TLS_CIPHER_SUITE_INT, TlsParams.TLS_NULL_WITH_NULL_NULL); sDefaults.putBoolean(KEY_SHOW_FORWARDED_NUMBER_BOOL, false); - sDefaults.putLong(KEY_DATA_SWITCH_VALIDATION_MIN_GAP_LONG, TimeUnit.DAYS.toMillis(1)); + sDefaults.putLong(KEY_DATA_SWITCH_VALIDATION_MIN_INTERVAL_MILLIS_LONG, + TimeUnit.DAYS.toMillis(1)); sDefaults.putStringArray(KEY_MISSED_INCOMING_CALL_SMS_ORIGINATOR_STRING_ARRAY, new String[0]); sDefaults.putStringArray(KEY_APN_PRIORITY_STRING_ARRAY, new String[] {