From 9b56ad8f1a7e2c97423171bf15b0dc303f12d4c1 Mon Sep 17 00:00:00 2001 From: Jonathan Basseri Date: Mon, 27 Apr 2015 14:14:38 -0700 Subject: [PATCH] Moving all Telephony overlays to CarrierConfigManager. This adds every variable and its default value from packages/services/Telephony/res/values/config.xml to the new CarrierConfigManager API. Variable docstrings are also taken from config.xml, with minimal edits. These variables were not included because either they are not carrier specific, or they are device specific: OtaPlaySuccessFailureTone OtaShowActivateFailTimes OtaShowActivationScreen OtaShowListeningScreen carrier_settings carrier_settings_menu config_allow_hfa_outside_of_setup_wizard config_enabled_lte csp_enabled dialer_default_class dtmf_type_enabled hac_enabled send_mic_mute_to_AudioManager ui_default_package This also adds BOOL_HIDE_CARRIER_NETWORK_SETTINGS which is a replacement for android.provider.Settings.Global.HIDE_CARRIER_NETWORK_SETTINGS. Bug: 20270007 Change-Id: I985a55cf88d3bd1863e28af7790b59eef01d6504 --- api/current.txt | 23 +++ api/system-current.txt | 23 +++ .../telephony/CarrierConfigManager.java | 188 +++++++++++++++--- 3 files changed, 208 insertions(+), 26 deletions(-) diff --git a/api/current.txt b/api/current.txt index 3ba9483effe80..cef1fd2e0c384 100644 --- a/api/current.txt +++ b/api/current.txt @@ -30683,11 +30683,34 @@ package android.telephony { method public android.os.Bundle getConfigForSubId(int); method public void reloadCarrierConfigForSubId(int); field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; + field public static final java.lang.String BOOL_ADDITIONAL_CALL_SETTING = "bool_additional_call_setting"; + field public static final java.lang.String BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG = "bool_allow_emergency_numbers_in_call_log"; + field public static final java.lang.String BOOL_ALLOW_LOCAL_DTMF_TONES = "bool_allow_local_dtmf_tones"; field public static final java.lang.String BOOL_APN_EXPAND = "bool_apn_expand"; + field public static final java.lang.String BOOL_AUTO_RETRY_ENABLED = "bool_auto_retry_enabled"; + field public static final java.lang.String BOOL_CARRIER_SETTINGS_ENABLE = "bool_carrier_settings_enable"; field public static final java.lang.String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available"; field public static final java.lang.String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned"; field public static final java.lang.String BOOL_CARRIER_VOLTE_TTY_SUPPORTED = "bool_carrier_volte_tty_supported"; + field public static final java.lang.String BOOL_DISABLE_CDMA_ACTIVATION_CODE = "bool_disable_cdma_activation_code"; + field public static final java.lang.String BOOL_DTMF_TYPE_ENABLED = "bool_dtmf_type_enabled"; + field public static final java.lang.String BOOL_ENABLE_DIALER_KEY_VIBRATION = "bool_enable_dialer_key_vibration"; + field public static final java.lang.String BOOL_HAS_IN_CALL_NOISE_SUPPRESSION = "bool_has_in_call_noise_suppression"; + field public static final java.lang.String BOOL_HIDE_CARRIER_NETWORK_SETTINGS = "bool_hide_carrier_network_settings"; + field public static final java.lang.String BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS = "bool_ignore_sim_network_locked_events"; + field public static final java.lang.String BOOL_OPERATOR_SELECTION_EXPAND = "bool_operator_selection_expand"; + field public static final java.lang.String BOOL_PREFER_2G = "bool_prefer_2g"; field public static final java.lang.String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; + field public static final java.lang.String BOOL_SHOW_CDMA = "bool_show_cdma"; + field public static final java.lang.String BOOL_SHOW_ONSCREEN_DIAL_BUTTON = "bool_show_onscreen_dial_button"; + field public static final java.lang.String BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS = "bool_sim_network_unlock_allow_dismiss"; + field public static final java.lang.String BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS = "bool_support_pause_ims_video_calls"; + field public static final java.lang.String BOOL_SUPPORT_SWAP_AFTER_MERGE = "bool_support_swap_after_merge"; + field public static final java.lang.String BOOL_USE_HFA_FOR_PROVISIONING = "bool_use_hfa_for_provisioning"; + field public static final java.lang.String BOOL_USE_OTASP_FOR_PROVISIONING = "bool_use_otasp_for_provisioning"; + field public static final java.lang.String BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT = "bool_voicemail_notification_persistent"; + field public static final java.lang.String BOOL_VOICE_PRIVACY_DISABLE = "bool_voice_privacy_disable"; + field public static final java.lang.String BOOL_WORLD_PHONE = "bool_world_phone"; field public static final java.lang.String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat"; } diff --git a/api/system-current.txt b/api/system-current.txt index 77e9366b998b5..dbf47b9158a02 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -32846,11 +32846,34 @@ package android.telephony { method public void reloadCarrierConfigForSubId(int); method public void updateConfigForPhoneId(int, java.lang.String); field public static final java.lang.String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; + field public static final java.lang.String BOOL_ADDITIONAL_CALL_SETTING = "bool_additional_call_setting"; + field public static final java.lang.String BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG = "bool_allow_emergency_numbers_in_call_log"; + field public static final java.lang.String BOOL_ALLOW_LOCAL_DTMF_TONES = "bool_allow_local_dtmf_tones"; field public static final java.lang.String BOOL_APN_EXPAND = "bool_apn_expand"; + field public static final java.lang.String BOOL_AUTO_RETRY_ENABLED = "bool_auto_retry_enabled"; + field public static final java.lang.String BOOL_CARRIER_SETTINGS_ENABLE = "bool_carrier_settings_enable"; field public static final java.lang.String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available"; field public static final java.lang.String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned"; field public static final java.lang.String BOOL_CARRIER_VOLTE_TTY_SUPPORTED = "bool_carrier_volte_tty_supported"; + field public static final java.lang.String BOOL_DISABLE_CDMA_ACTIVATION_CODE = "bool_disable_cdma_activation_code"; + field public static final java.lang.String BOOL_DTMF_TYPE_ENABLED = "bool_dtmf_type_enabled"; + field public static final java.lang.String BOOL_ENABLE_DIALER_KEY_VIBRATION = "bool_enable_dialer_key_vibration"; + field public static final java.lang.String BOOL_HAS_IN_CALL_NOISE_SUPPRESSION = "bool_has_in_call_noise_suppression"; + field public static final java.lang.String BOOL_HIDE_CARRIER_NETWORK_SETTINGS = "bool_hide_carrier_network_settings"; + field public static final java.lang.String BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS = "bool_ignore_sim_network_locked_events"; + field public static final java.lang.String BOOL_OPERATOR_SELECTION_EXPAND = "bool_operator_selection_expand"; + field public static final java.lang.String BOOL_PREFER_2G = "bool_prefer_2g"; field public static final java.lang.String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; + field public static final java.lang.String BOOL_SHOW_CDMA = "bool_show_cdma"; + field public static final java.lang.String BOOL_SHOW_ONSCREEN_DIAL_BUTTON = "bool_show_onscreen_dial_button"; + field public static final java.lang.String BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS = "bool_sim_network_unlock_allow_dismiss"; + field public static final java.lang.String BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS = "bool_support_pause_ims_video_calls"; + field public static final java.lang.String BOOL_SUPPORT_SWAP_AFTER_MERGE = "bool_support_swap_after_merge"; + field public static final java.lang.String BOOL_USE_HFA_FOR_PROVISIONING = "bool_use_hfa_for_provisioning"; + field public static final java.lang.String BOOL_USE_OTASP_FOR_PROVISIONING = "bool_use_otasp_for_provisioning"; + field public static final java.lang.String BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT = "bool_voicemail_notification_persistent"; + field public static final java.lang.String BOOL_VOICE_PRIVACY_DISABLE = "bool_voice_privacy_disable"; + field public static final java.lang.String BOOL_WORLD_PHONE = "bool_world_phone"; field public static final java.lang.String INT_VOLTE_REPLACEMENT_RAT = "int_volte_replacement_rat"; } diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 831a194605250..299c7c446b765 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -47,6 +47,134 @@ public class CarrierConfigManager { public static final String ACTION_CARRIER_CONFIG_CHANGED = "android.telephony.action.CARRIER_CONFIG_CHANGED"; + /** + * Flag indicating whether the Phone app should ignore EVENT_SIM_NETWORK_LOCKED + * events from the Sim. + * If true, this will prevent the IccNetworkDepersonalizationPanel from being shown, and + * effectively disable the "Sim network lock" feature. + */ + public static final String + BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS = "bool_ignore_sim_network_locked_events"; + + /** + * Flag indicating whether the Phone app should provide a "Dismiss" button on the SIM network + * unlock screen. The default value is true. If set to false, there will be *no way* to dismiss + * the SIM network unlock screen if you don't enter the correct unlock code. (One important + * consequence: there will be no way to make an Emergency Call if your SIM is network-locked and + * you don't know the PIN.) + */ + public static final String + BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS = "bool_sim_network_unlock_allow_dismiss"; + + /** Flag indicating if the phone is a world phone */ + public static final String BOOL_WORLD_PHONE = "bool_world_phone"; + + /** + * If true, enable vibration (haptic feedback) for key presses in the EmergencyDialer activity. + * The pattern is set on a per-platform basis using config_virtualKeyVibePattern. To be + * consistent with the regular Dialer, this value should agree with the corresponding values + * from config.xml under apps/Contacts. + */ + public static final String + BOOL_ENABLE_DIALER_KEY_VIBRATION = "bool_enable_dialer_key_vibration"; + + /** Flag indicating if dtmf tone type is enabled */ + public static final String BOOL_DTMF_TYPE_ENABLED = "bool_dtmf_type_enabled"; + + /** Flag indicating if auto retry is enabled */ + public static final String BOOL_AUTO_RETRY_ENABLED = "bool_auto_retry_enabled"; + + /** + * Determine whether we want to play local DTMF tones in a call, or just let the radio/BP handle + * playing of the tones. + */ + public static final String BOOL_ALLOW_LOCAL_DTMF_TONES = "bool_allow_local_dtmf_tones"; + + /** + * If true, show an onscreen "Dial" button in the dialer. In practice this is used on all + * platforms, even the ones with hard SEND/END keys, but for maximum flexibility it's controlled + * by a flag here (which can be overridden on a per-product basis.) + */ + public static final String BOOL_SHOW_ONSCREEN_DIAL_BUTTON = "bool_show_onscreen_dial_button"; + + /** Determines if device implements a noise suppression device for in call audio. */ + public static final String + BOOL_HAS_IN_CALL_NOISE_SUPPRESSION = "bool_has_in_call_noise_suppression"; + + /** + * Determines if the current device should allow emergency numbers to be logged in the Call Log. + * (Some carriers require that emergency calls *not* be logged, presumably to avoid the risk of + * accidental redialing from the call log UI. This is a good idea, so the default here is + * false.) + *

+ * TODO: on the other hand, it might still be useful to have some record of the emergency calls + * you've made, or to be able to look up the exact date/time of an emergency call. So perhaps we + * should log those calls, but instead fix the call log to disable the "call" button for + * emergency numbers. + */ + public static final String + BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG = "bool_allow_emergency_numbers_in_call_log"; + + /** If true, removes the Voice Privacy option from Call Settings */ + public static final String BOOL_VOICE_PRIVACY_DISABLE = "bool_voice_privacy_disable"; + + /** Control whether users can reach the carrier portions of Cellular Network Settings. */ + public static final String + BOOL_HIDE_CARRIER_NETWORK_SETTINGS = "bool_hide_carrier_network_settings"; + + /** Control whether users can edit APNs in Settings. */ + public static final String BOOL_APN_EXPAND = "bool_apn_expand"; + + /** Control whether users can choose a network operator. */ + public static final String BOOL_OPERATOR_SELECTION_EXPAND = "bool_operator_selection_expand"; + + /** Used in Cellular Network Settings for preferred network type. */ + public static final String BOOL_PREFER_2G = "bool_prefer_2g"; + + /** Show cdma auto network mode in (glabal) roaming */ + public static final String BOOL_SHOW_CDMA = "bool_show_cdma"; + + /** CDMA activation goes through HFA */ + public static final String BOOL_USE_HFA_FOR_PROVISIONING = "bool_use_hfa_for_provisioning"; + + /** + * CDMA activation goes through OTASP. + *

+ * TODO: This should be combined with config_use_hfa_for_provisioning and implemented as an enum + * (NONE, HFA, OTASP). + */ + public static final String BOOL_USE_OTASP_FOR_PROVISIONING = "bool_use_otasp_for_provisioning"; + + /** Display carrier settings menu if true */ + public static final String BOOL_CARRIER_SETTINGS_ENABLE = "bool_carrier_settings_enable"; + + /** Does not display additional call seting for IMS phone based on GSM Phone */ + public static final String BOOL_ADDITIONAL_CALL_SETTING = "bool_additional_call_setting"; + + /** Show APN Settings for some CDMA carriers */ + public static final String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; + + /** After a CDMA conference call is merged, the swap button should be displayed. */ + public static final String BOOL_SUPPORT_SWAP_AFTER_MERGE = "bool_support_swap_after_merge"; + + /** + * Determine whether the voicemail notification is persistent in the notification bar. If true, + * the voicemail notifications cannot be dismissed from the notification bar. + */ + public static final String + BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT = "bool_voicemail_notification_persistent"; + + /** For IMS video over LTE calls, determines whether video pause signalling is supported. */ + public static final String + BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS = "bool_support_pause_ims_video_calls"; + + /** + * Disables dialing "*228" (OTASP provisioning) on CDMA carriers where it is not supported or is + * potentially harmful by locking the SIM to 3G. + */ + public static final String + BOOL_DISABLE_CDMA_ACTIVATION_CODE = "bool_disable_cdma_activation_code"; + /** * Flag specifying whether VoLTE should be available for carrier, independent of carrier * provisioning. If false: hard disabled. If true: then depends on carrier provisioning, @@ -54,27 +182,13 @@ public class CarrierConfigManager { */ public static final String BOOL_CARRIER_VOLTE_AVAILABLE = "bool_carrier_volte_available"; - /** - * Flag specifying whether VoLTE availability is based on provisioning. - */ + /** Flag specifying whether VoLTE availability is based on provisioning. */ public static final String BOOL_CARRIER_VOLTE_PROVISIONED = "bool_carrier_volte_provisioned"; - /** - * Flag specifying whether VoLTE TTY is supported. - */ + /** Flag specifying whether VoLTE TTY is supported. */ public static final String BOOL_CARRIER_VOLTE_TTY_SUPPORTED = "bool_carrier_volte_tty_supported"; - /** - * Show APN Settings for some CDMA carriers. - */ - public static final String BOOL_SHOW_APN_SETTING_CDMA = "bool_show_apn_setting_cdma"; - - /** - * Control whether users can edit APNs in Settings. - */ - public static final String BOOL_APN_EXPAND = "bool_apn_expand"; - /** * If Voice Radio Technology is RIL_RADIO_TECHNOLOGY_LTE:14 or RIL_RADIO_TECHNOLOGY_UNKNOWN:0 * this is the value that should be used instead. A configuration value of @@ -86,9 +200,9 @@ public class CarrierConfigManager { /* The following 3 fields are related to carrier visual voicemail. */ /** - * The carrier number MO sms messages are sent to. + * The carrier number MO sms messages are sent to. * - * @hide + * @hide */ public static final String STRING_VVM_DESTINATION_NUMBER = "string_vvm_destination_number"; @@ -122,17 +236,38 @@ public class CarrierConfigManager { static { sDefaults = new Bundle(); + sDefaults.putBoolean(BOOL_ADDITIONAL_CALL_SETTING, true); + sDefaults.putBoolean(BOOL_ALLOW_EMERGENCY_NUMBERS_IN_CALL_LOG, false); + sDefaults.putBoolean(BOOL_ALLOW_LOCAL_DTMF_TONES, true); + sDefaults.putBoolean(BOOL_APN_EXPAND, true); + sDefaults.putBoolean(BOOL_AUTO_RETRY_ENABLED, false); + sDefaults.putBoolean(BOOL_CARRIER_SETTINGS_ENABLE, false); sDefaults.putBoolean(BOOL_CARRIER_VOLTE_AVAILABLE, false); sDefaults.putBoolean(BOOL_CARRIER_VOLTE_PROVISIONED, false); sDefaults.putBoolean(BOOL_CARRIER_VOLTE_TTY_SUPPORTED, true); + sDefaults.putBoolean(BOOL_DISABLE_CDMA_ACTIVATION_CODE, false); + sDefaults.putBoolean(BOOL_DTMF_TYPE_ENABLED, false); + sDefaults.putBoolean(BOOL_ENABLE_DIALER_KEY_VIBRATION, true); + sDefaults.putBoolean(BOOL_HAS_IN_CALL_NOISE_SUPPRESSION, false); + sDefaults.putBoolean(BOOL_HIDE_CARRIER_NETWORK_SETTINGS, false); + sDefaults.putBoolean(BOOL_IGNORE_SIM_NETWORK_LOCKED_EVENTS, false); + sDefaults.putBoolean(BOOL_OPERATOR_SELECTION_EXPAND, true); + sDefaults.putBoolean(BOOL_PREFER_2G, true); sDefaults.putBoolean(BOOL_SHOW_APN_SETTING_CDMA, false); - sDefaults.putBoolean(BOOL_APN_EXPAND, true); - + sDefaults.putBoolean(BOOL_SHOW_CDMA, false); + sDefaults.putBoolean(BOOL_SHOW_ONSCREEN_DIAL_BUTTON, true); + sDefaults.putBoolean(BOOL_SIM_NETWORK_UNLOCK_ALLOW_DISMISS, true); + sDefaults.putBoolean(BOOL_SUPPORT_PAUSE_IMS_VIDEO_CALLS, true); + sDefaults.putBoolean(BOOL_SUPPORT_SWAP_AFTER_MERGE, true); + sDefaults.putBoolean(BOOL_USE_HFA_FOR_PROVISIONING, false); + sDefaults.putBoolean(BOOL_USE_OTASP_FOR_PROVISIONING, false); + sDefaults.putBoolean(BOOL_VOICEMAIL_NOTIFICATION_PERSISTENT, false); + sDefaults.putBoolean(BOOL_VOICE_PRIVACY_DISABLE, false); + sDefaults.putBoolean(BOOL_WORLD_PHONE, false); sDefaults.putInt(INT_VOLTE_REPLACEMENT_RAT, 0); - + sDefaults.putInt(INT_VVM_PORT_NUMBER, 0); sDefaults.putString(STRING_VVM_DESTINATION_NUMBER, ""); sDefaults.putString(STRING_VVM_TYPE, ""); - sDefaults.putInt(INT_VVM_PORT_NUMBER, 0); } /** @@ -190,10 +325,11 @@ public class CarrierConfigManager { /** * Request the carrier config loader to update the cofig for phoneId. - * - * Depending on simState, the config may be cleared or loaded from config app. - * This is only used by SubscriptionInfoUpdater. - * + *

+ * Depending on simState, the config may be cleared or loaded from config app. This is only used + * by SubscriptionInfoUpdater. + *

+ * * @hide */ @SystemApi