Support hf functionality for IVI
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-telephony.c
old mode 100755 (executable)
new mode 100644 (file)
index 9f6bca4..0e22c2e
@@ -93,8 +93,7 @@ static const gchar bt_telephony_introspection_xml[] =
 
 #define BT_TELEPHONY_CHECK_ENABLED() \
        do { \
-               if (bluetooth_check_adapter() == BLUETOOTH_ADAPTER_DISABLED) \
-               { \
+               if (bluetooth_check_adapter() == BLUETOOTH_ADAPTER_DISABLED) { \
                        BT_ERR("BT is not enabled"); \
                        return BLUETOOTH_TELEPHONY_ERROR_NOT_ENABLED; \
                } \
@@ -103,8 +102,7 @@ static const gchar bt_telephony_introspection_xml[] =
 static gboolean is_initialized = FALSE;
 #define BT_TELEPHONY_CHECK_INITIALIZED() \
        do { \
-               if (is_initialized == FALSE) \
-               { \
+               if (is_initialized == FALSE) { \
                        BT_ERR("Bluetooth telephony not initilized"); \
                        return BLUETOOTH_TELEPHONY_ERROR_NOT_INITIALIZED; \
                } \
@@ -310,7 +308,7 @@ static GVariant *__bluetooth_telephony_dbus_method_send(const char *path,
                const char *interface, const char *method,
                GError **err, GVariant *parameters)
 {
-#ifdef TIZEN_WEARABLE
+#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        int timeout = 4000;
 #else
        int timeout = -1;
@@ -802,7 +800,7 @@ static  int __bluetooth_telephony_unregister(void)
        return BLUETOOTH_TELEPHONY_ERROR_NONE;
 }
 
-#ifndef TIZEN_WEARABLE
+#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
 static void __bluetooth_telephony_init_headset_state(void)
 {
        GVariant *reply;
@@ -1408,7 +1406,7 @@ BT_EXPORT_API int bluetooth_telephony_init(bt_telephony_func_ptr cb,
                goto fail;
        }
 
-#ifndef TIZEN_WEARABLE
+#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        __bluetooth_telephony_init_headset_state();
 #endif
 
@@ -1491,7 +1489,7 @@ BT_EXPORT_API gboolean bluetooth_telephony_is_sco_connected(void)
        g_variant_get(reply, "(b)", &status);
        g_variant_unref(reply);
 
-#ifdef TIZEN_WEARABLE
+#if defined(TIZEN_PROFILE_WEARABLE) || defined(TIZEN_PROFILE_IVI)
        if (status == TRUE && telephony_info.headset_state != BLUETOOTH_STATE_PLAYING)
                telephony_info.headset_state = BLUETOOTH_STATE_PLAYING;
 #endif