#include <stdint.h>
#include <glib.h>
+#ifdef TIZEN_TV
+#include <vconf.h>
+#endif
+
#include <mm_error.h>
#include <mm_debug.h>
return ret;
}
+#ifdef TIZEN_TV
+#define _VCONF_KEY_SOUND_SPEAKER_SELECTION "file/private/sound/feature/SpeakerSelection"
+#define _AUDIO_TV_OUTPUT_BT_HEADSET 5
+
+static mm_sound_device_t* _get_tv_bt_device(void)
+{
+ int speaker_value = 0;
+ mm_sound_device_t* device_item = NULL;
+
+ if (vconf_get_int(_VCONF_KEY_SOUND_SPEAKER_SELECTION, &speaker_value) == VCONF_ERROR) {
+ debug_error("vconf_get_int(%s) failed..", _VCONF_KEY_SOUND_SPEAKER_SELECTION);
+ return NULL;
+ }
+
+ debug_warning("speaker selection value = %d", speaker_value);
+ if (speaker_value != _AUDIO_TV_OUTPUT_BT_HEADSET)
+ return NULL;
+
+ device_item = g_malloc0(sizeof(mm_sound_device_t));
+ if (!device_item)
+ return NULL;
+
+ MMSOUND_STRNCPY(device_item->name, "BluetoothMedia", MAX_DEVICE_NAME_NUM);
+ MMSOUND_STRNCPY(device_item->type, "bt-a2dp", MAX_DEVICE_TYPE_STR_LEN);
+ device_item->id = 99;
+ device_item->io_direction = DEVICE_IO_DIRECTION_OUT;
+ device_item->state = DEVICE_STATE_ACTIVATED;
+ device_item->vendor_id = -1;
+ device_item->product_id = -1;
+ device_item->stream_num = -1;
+
+ return device_item;
+}
+#endif /* TIZEN_TV */
+
int mm_sound_proxy_get_current_connected_device_list(int device_flags, GList** device_list)
{
int ret = MM_ERROR_NONE;
}
}
+
+#ifdef TIZEN_TV
+ device_item = _get_tv_bt_device();
+ if (device_item) {
+ *device_list = g_list_append(*device_list, device_item);
+ debug_msg("Added TV bt device id(%d) type(%17s) direction(%d) state(%d) name(%s) vendor-id(%04x) product-id(%04x)",
+ device_item->id, device_item->type, device_item->io_direction, device_item->state,
+ device_item->name, device_item->vendor_id, device_item->product_id);
+ }
+#endif /* TIZEN_TV */
+
cleanup:
if (result)
g_variant_unref(result);