Fix the coding rule
[platform/core/connectivity/bluetooth-agent.git] / hf-agent / bluetooth-hf-agent.c
index d84f39b..bf9b365 100755 (executable)
@@ -2370,21 +2370,21 @@ static gboolean __bt_hf_agent_sco_accept_cb(GIOChannel *chan, GIOCondition cond,
 void _bt_convert_addr_string_to_type_rev(unsigned char *addr,
                                        const char *address)
 {
-        int i;
-        char *ptr = NULL;
+       int i;
+       char *ptr = NULL;
 
        ret_if(address == NULL);
        ret_if(addr == NULL);
 
-        for (i = 0; i < 6; i++) {
-                addr[5 - i] = strtol(address, &ptr, 16);
-                if (ptr[0] != '\0') {
-                        if (ptr[0] != ':')
-                                return;
+       for (i = 0; i < 6; i++) {
+               addr[5 - i] = strtol(address, &ptr, 16);
+               if (ptr[0] != '\0') {
+                       if (ptr[0] != ':')
+                               return;
 
-                        address = ptr + 1;
-                }
-        }
+                       address = ptr + 1;
+               }
+       }
 }
 
 static gboolean __bt_hf_agent_sco_accept(bt_hf_agent_info_t *bt_hf_info)
@@ -2551,8 +2551,11 @@ static gboolean __bt_establish_service_level_conn(bt_hf_agent_info_t *bt_hf_info
                        BT_HF_FEATURE_CLI_PRESENTATION |
                        BT_HF_FEATURE_VOICE_RECOGNITION |
                        BT_HF_FEATURE_REMOTE_VOLUME_CONTROL |
-                       BT_HF_FEATURE_ENHANCED_CALL_STATUS |
-                       BT_HF_FEATURE_CODEC_NEGOTIATION;
+                       BT_HF_FEATURE_ENHANCED_CALL_STATUS;
+
+#ifdef TIZEN_WEARABLE
+       feature = feature | BT_HF_FEATURE_CODEC_NEGOTIATION;
+#endif
 
        snprintf(cmd_buf, sizeof(cmd_buf), BT_HF_FEATURES, feature);
        ret = __bt_hf_send_and_read(bt_hf_info, cmd_buf, buf,
@@ -2568,6 +2571,7 @@ static gboolean __bt_establish_service_level_conn(bt_hf_agent_info_t *bt_hf_info
                return FALSE;
        INFO("Gateway supported features are 0x%X", bt_hf_info->ag_features);
 
+#ifdef TIZEN_WEARABLE
        if (bt_hf_info->ag_features & BT_AG_FEATURE_CODEC_NEGOTIATION) {
                ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_MSBC);
                if (ret != BT_HF_AGENT_ERROR_NONE)
@@ -2576,7 +2580,9 @@ static gboolean __bt_establish_service_level_conn(bt_hf_agent_info_t *bt_hf_info
                ret = __bt_hf_send_available_codec(bt_hf_info, 0);
                if (!ret)
                        return FALSE;
-       } else {
+       } else
+#endif
+       {
                /* Default codec is NB */
                ret = _hf_agent_codec_setup(bt_hf_info->remote_addr, BT_HF_CODEC_ID_CVSD);
                if (ret != BT_HF_AGENT_ERROR_NONE)
@@ -3322,7 +3328,6 @@ static int bt_hf_agent_send_at_cmd(GDBusMethodInvocation *context, char *atcmd)
 
 static uint32_t __bt_hf_agent_get_hf_features(void)
 {
-
        uint32_t hf_features = BT_HF_FEATURE_EC_ANDOR_NR |
                        BT_HF_FEATURE_CALL_WAITING_AND_3WAY |
                        BT_HF_FEATURE_CLI_PRESENTATION |
@@ -3331,6 +3336,10 @@ static uint32_t __bt_hf_agent_get_hf_features(void)
                        BT_HF_FEATURE_ENHANCED_CALL_STATUS |
                        BT_HF_FEATURE_CODEC_NEGOTIATION;
 
+#ifdef TIZEN_WEARABLE
+       hf_features = hf_features | BT_HF_FEATURE_CODEC_NEGOTIATION;
+#endif
+
        hf_ver = HFP_VERSION_1_6;
 
        return hf_features;