Use secure atcmd on log to protect private information.
[platform/core/connectivity/bluetooth-agent.git] / ag-agent / bluetooth-ag-agent.c
index c1d9595..00cb6c2 100644 (file)
@@ -1633,10 +1633,14 @@ static bt_hfp_agent_error_t __bt_hfp_send_bcs_command(bt_ag_info_t *hs,
        uint32_t codec;
        struct ag_codec *data = NULL;;
 
-       if (hs->codec_info.remote_codecs & BT_MSBC_CODEC_MASK)
-               codec = BT_MSBC_CODEC_ID;
-       else
+       if (TIZEN_MODEL_NAME_TM1) {
                codec = BT_CVSD_CODEC_ID;
+       } else {
+               if (hs->codec_info.remote_codecs & BT_MSBC_CODEC_MASK)
+                       codec = BT_MSBC_CODEC_ID;
+               else
+                       codec = BT_CVSD_CODEC_ID;
+       }
 
        if (wbs_opts.wbs_enable == FALSE)
                codec = BT_CVSD_CODEC_ID;
@@ -2360,7 +2364,7 @@ static struct event at_event_callbacks[] = {
 int num_of_secure_command = 4;
 static const char* secure_command[] = {"CLCC", "CLIP", "CPBR", "CCWA"};
 
-void __bt_ag_agent_print_at_buffer(char *message, const char *buf)
+static void __bt_ag_agent_print_at_buffer(char *message, const char *buf)
 {
 
        int i = 0;
@@ -4364,12 +4368,22 @@ static void __bt_ag_agent_dbus_init(void)
 static uint32_t __bt_ag_agent_get_ag_features(void)
 {
 
-       uint32_t ag_features = BT_AG_FEATURE_EC_AND_NR |
+       uint32_t ag_features;
+
+       if (TIZEN_MODEL_NAME_TM1) {
+               ag_features = BT_AG_FEATURE_EC_AND_NR |
+                               BT_AG_FEATURE_REJECT_CALL |
+                               BT_AG_FEATURE_ENHANCED_CALL_STATUS |
+                               BT_AG_FEATURE_THREE_WAY_CALL |
+                               BT_AG_FEATURE_EXTENDED_ERROR_RESULT_CODES;
+       } else {
+               ag_features = BT_AG_FEATURE_EC_AND_NR |
                                BT_AG_FEATURE_REJECT_CALL |
                                BT_AG_FEATURE_ENHANCED_CALL_STATUS |
                                BT_AG_FEATURE_THREE_WAY_CALL |
                                BT_AG_FEATURE_VOICE_RECOGNITION |
                                BT_AG_FEATURE_EXTENDED_ERROR_RESULT_CODES;
+       }
 
        wbs_en = TRUE;
 #if defined(TIZEN_FEATURE_BT_HFP_AG)
@@ -4411,7 +4425,7 @@ int main(void)
        int i;
        uint32_t ag_features;
        struct sigaction sa;
-       pthread_t thread_id;
+       pthread_t thread_id = 0;
 
        INFO_C("### Starting Bluetooth AG agent");