#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)
+static mm_sound_device_t* _get_tv_bt_device(int device_flags)
{
int speaker_value = 0;
mm_sound_device_t* device_item = NULL;
+ /* check precondition mask first here */
+ if (device_flags != DEVICE_ALL_FLAG) {
+ if (!(device_flags & DEVICE_IO_DIRECTION_OUT_FLAG)) {
+ debug_warning("no out flag given, skip checking bt a2dp");
+ return NULL;
+ }
+ if (device_flags & DEVICE_TYPE_INTERNAL_FLAG) {
+ debug_warning("internal flag given, skip checking bt a2dp");
+ return NULL;
+ }
+ if (device_flags & DEVICE_STATE_DEACTIVATED_FLAG) {
+ debug_warning("deactivated flag given, skip checking bt a2dp");
+ return 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;
g_variant_unref(child);
#ifdef TIZEN_TV
- device_item = _get_tv_bt_device();
+ device_item = _get_tv_bt_device(device_flags);
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)",