Set a readout notification of tts when AV connected 23/225723/1
authorDeokhyun Kim <dukan.kim@samsung.com>
Mon, 24 Feb 2020 06:53:35 +0000 (15:53 +0900)
committerDeokhyun Kim <dukan.kim@samsung.com>
Mon, 24 Feb 2020 06:53:35 +0000 (15:53 +0900)
Change-Id: Ib8a505ad4ef39f6268a4c55738768f32c1879e5c
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
bt-service-adaptation/services/audio/a2dp_src/bt-service-a2dp-src.c
bt-service-adaptation/services/bt-service-common.c
bt-service-adaptation/services/include/bt-service-common.h

index 8df461a..caf7515 100644 (file)
@@ -85,6 +85,11 @@ static void __bt_handle_av_connected_state(bluetooth_device_address_t *address)
        /* Set VCONF Key for A2DP Connected status */
        _bt_set_device_values(TRUE, VCONFKEY_BT_DEVICE_A2DP_HEADSET_CONNECTED);
 
+       /* Set readout notification of tts */
+#ifdef TIZEN_FEATURE_READOUT_NOTIFICATION
+       _bt_set_readout_notification_of_tts();
+#endif
+
        /* Send A2DP(SRC Role) connected event to Application */
        param = g_variant_new("(is)", result, addr);
        _bt_send_event(BT_HEADSET_EVENT, BLUETOOTH_EVENT_AV_CONNECTED, param);
index d6ed3b7..fb4110f 100644 (file)
@@ -1443,6 +1443,24 @@ void _bt_set_device_values(gboolean connected, int state)
                BT_ERR("vconf_set_int failed");
 }
 
+#ifdef TIZEN_FEATURE_READOUT_NOTIFICATION
+void _bt_set_readout_notification_of_tts(void)
+{
+       int tts_setting;
+
+       if (vconf_get_int(VCONFKEY_TTS_SETTING_NOTIFICATION_TTS, &tts_setting) != 0) {
+               BT_ERR("vconf_get_int failed");
+               return;
+       }
+
+       BT_DBG("current value[%d]", tts_setting);
+
+       if (tts_setting == -1)
+               if (vconf_set_int(VCONFKEY_TTS_SETTING_NOTIFICATION_TTS, -1) != 0)
+                       BT_ERR("vconf_set_int failed");
+}
+#endif
+
 int _bt_get_ad_data_by_type(char *in_data, int in_len,
                char in_type, char **data, int *data_len)
 {
index bb32986..9698cd9 100644 (file)
@@ -432,6 +432,10 @@ void _bt_free_remote_dev(bt_remote_dev_info_t * dev_info);
 
 void _bt_set_device_values(gboolean connected, int state);
 
+#ifdef TIZEN_FEATURE_READOUT_NOTIFICATION
+void _bt_set_readout_notification_of_tts(void);
+#endif
+
 void _bt_string_to_uuid(char *str, service_uuid_t *p_uuid);
 
 int _bt_get_ad_data_by_type(char *in_data, int in_len,