From 8b2ded491cb7e699f685fe898d521552ecaff2b4 Mon Sep 17 00:00:00 2001 From: Hunsuk Choi Date: Mon, 17 Jan 2022 07:35:19 +0000 Subject: [PATCH] Add configuration items for the terminal-based call waiting service The following keys are added: - KEY_TERMINAL_BASED_CALL_WAITING_SYNC_TYPE_INT - KEY_TERMINAL_BASED_CALL_WAITING_DEFAULT_ENABLED_BOOL Bug: 202463005 Test: atest FrameworksTelephonyTests:CallWaitingControllerTest Change-Id: Id0a632dcef6caace6d798428388baf2727eb8d60 (cherry picked from commit a32fd53f1388f25ec4790132105f607db3258f44) Merged-In: Id0a632dcef6caace6d798428388baf2727eb8d60 --- core/api/current.txt | 7 ++ .../telephony/CarrierConfigManager.java | 97 +++++++++++++++++++ 2 files changed, 104 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index 8520e757bf8b1..b4f75d4fb193e 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -41697,8 +41697,15 @@ package android.telephony { } public static final class CarrierConfigManager.ImsSs { + field public static final int CALL_WAITING_SYNC_FIRST_CHANGE = 3; // 0x3 + field public static final int CALL_WAITING_SYNC_FIRST_POWER_UP = 2; // 0x2 + field public static final int CALL_WAITING_SYNC_IMS_ONLY = 4; // 0x4 + field public static final int CALL_WAITING_SYNC_NONE = 0; // 0x0 + field public static final int CALL_WAITING_SYNC_USER_CHANGE = 1; // 0x1 field public static final String KEY_NETWORK_INITIATED_USSD_OVER_IMS_SUPPORTED_BOOL = "imsss.network_initiated_ussd_over_ims_supported_bool"; field public static final String KEY_PREFIX = "imsss."; + field public static final String KEY_TERMINAL_BASED_CALL_WAITING_DEFAULT_ENABLED_BOOL = "imsss.terminal_based_call_waiting_default_enabled_bool"; + field public static final String KEY_TERMINAL_BASED_CALL_WAITING_SYNC_TYPE_INT = "imsss.terminal_based_call_waiting_sync_type_int"; field public static final String KEY_USE_CSFB_ON_XCAP_OVER_UT_FAILURE_BOOL = "imsss.use_csfb_on_xcap_over_ut_failure_bool"; field public static final String KEY_UT_AS_SERVER_FQDN_STRING = "imsss.ut_as_server_fqdn_string"; field public static final String KEY_UT_AS_SERVER_PORT_INT = "imsss.ut_as_server_port_int"; diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 70fe6b10ef20c..0bf4088e7f399 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -7723,6 +7723,100 @@ public class CarrierConfigManager { public static final String KEY_XCAP_OVER_UT_SUPPORTED_RATS_INT_ARRAY = KEY_PREFIX + "xcap_over_ut_supported_rats_int_array"; + /** @hide */ + @IntDef({ + CALL_WAITING_SYNC_NONE, + CALL_WAITING_SYNC_USER_CHANGE, + CALL_WAITING_SYNC_FIRST_POWER_UP, + CALL_WAITING_SYNC_FIRST_CHANGE, + CALL_WAITING_SYNC_IMS_ONLY + }) + + public @interface CwSyncType {} + + /** + * Do not synchronize the user's call waiting setting with the network. Call waiting is + * always enabled on the carrier network and the user setting for call waiting is applied + * on the terminal side. If the user disables call waiting, the call will be rejected on + * the terminal. + */ + public static final int CALL_WAITING_SYNC_NONE = 0; + + /** + * The change of user’s setting is always passed to the carrier network + * and then synchronized to the terminal based call waiting solution over IMS. + * If changing the service over the carrier network is not successful, + * the setting over IMS shall not be changed. + */ + public static final int CALL_WAITING_SYNC_USER_CHANGE = 1; + + /** + * Activate call waiting on the carrier network when the device boots or a subscription + * using this carrier is loaded. Call waiting is always considered enabled on the carrier + * network and the user setting for call waiting is applied on the terminal side only. If + * the user disables call waiting, the call will be rejected on the terminal. + * The mismatch between CS calls and IMS calls can happen when the network based call + * waiting service is in disabled state in the legacy 3G/2G networks while it's enabled + * in the terminal side. + */ + public static final int CALL_WAITING_SYNC_FIRST_POWER_UP = 2; + + /** + * Activate call waiting on the carrier network when the user enables call waiting the + * first time. Call waiting is then always considered enabled on the carrier network. If + * the user disables call waiting, the setting will only be applied to the terminal based + * call waiting service and the call will be rejected on the terminal. + * The mismatch between CS calls and IMS calls can happen when the network based call + * waiting service is in disabled state in the legacy 3G/2G networks while it's enabled + * in the terminal side. However, if the user retrieves the setting again when the device + * is in the legacy 3G/2G networks, the correct state will be shown to the user. + */ + public static final int CALL_WAITING_SYNC_FIRST_CHANGE = 3; + + /** + * Do not synchronize the call waiting service state between the carrier network and + * the terminal based IMS call waiting service. If the user changes the call waiting setting + * when IMS is registered, the change will only be applied to the terminal based call + * waiting service. If IMS is not registered when call waiting is changed, synchronize this + * setting with the carrier network. + */ + public static final int CALL_WAITING_SYNC_IMS_ONLY = 4; + + /** @hide */ + public static final int CALL_WAITING_SYNC_MAX = CALL_WAITING_SYNC_IMS_ONLY; + + /** + * Flag indicating the way to synchronize the setting between CS and IMS. + * + *

Possible values are, + * {@link #CALL_WAITING_SYNC_NONE}, + * {@link #CALL_WAITING_SYNC_USER_CHANGE}, + * {@link #CALL_WAITING_SYNC_FIRST_POWER_UP}, + * {@link #CALL_WAITING_SYNC_FIRST_CHANGE}, + * {@link #CALL_WAITING_SYNC_IMS_ONLY}. + * + * This configuration is valid only when + * {@link #KEY_UT_TERMINAL_BASED_SERVICES_INT_ARRAY} includes + * {@link #SUPPLEMENTARY_SERVICE_CW}. + * + *

If key is invalid or not configured, the default value + * {@link #CALL_WAITING_SYNC_FIRST_CHANGE} will apply. + */ + public static final String KEY_TERMINAL_BASED_CALL_WAITING_SYNC_TYPE_INT = + KEY_PREFIX + "terminal_based_call_waiting_sync_type_int"; + + /** + * Flag indicating whether the user setting for terminal-based call waiting + * is enabled by default or not. + * This configuration is valid only when + * {@link #KEY_UT_TERMINAL_BASED_SERVICES_INT_ARRAY} includes + * {@link #SUPPLEMENTARY_SERVICE_CW}. + * + * The default value for this key is {@code true}. + */ + public static final String KEY_TERMINAL_BASED_CALL_WAITING_DEFAULT_ENABLED_BOOL = + KEY_PREFIX + "terminal_based_call_waiting_default_enabled_bool"; + private static PersistableBundle getDefaults() { PersistableBundle defaults = new PersistableBundle(); defaults.putBoolean(KEY_UT_REQUIRES_IMS_REGISTRATION_BOOL, false); @@ -7773,6 +7867,9 @@ public class CarrierConfigManager { AccessNetworkType.IWLAN }); defaults.putString(KEY_UT_AS_SERVER_FQDN_STRING, ""); + defaults.putBoolean(KEY_TERMINAL_BASED_CALL_WAITING_DEFAULT_ENABLED_BOOL, true); + defaults.putInt(KEY_TERMINAL_BASED_CALL_WAITING_SYNC_TYPE_INT, + CALL_WAITING_SYNC_FIRST_CHANGE); return defaults; }