From: Seungbae Shin Date: Thu, 11 Mar 2021 10:57:39 +0000 (+0900) Subject: mm_sound_proxy: add bt-a2dp device to query list properly only if mask satisfied X-Git-Tag: accepted/tizen/unified/20210315.134147~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5945f38c7208b390a1d42dc2f7f44146f1f9c56b;p=platform%2Fcore%2Fmultimedia%2Flibmm-sound.git mm_sound_proxy: add bt-a2dp device to query list properly only if mask satisfied [Version] 0.13.5 [Issue Type] Bug (Product) Change-Id: I5035ba829f060bfc8638006b47787b3a0d9af4fb --- diff --git a/mm_sound_proxy.c b/mm_sound_proxy.c index 86e4621..6cd5b3f 100644 --- a/mm_sound_proxy.c +++ b/mm_sound_proxy.c @@ -370,11 +370,27 @@ cleanup: #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; @@ -453,7 +469,7 @@ int mm_sound_proxy_get_current_connected_device_list(int device_flags, GList** d 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)", diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index 8c8fb1b..531418d 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.13.4 +Version: 0.13.5 Release: 0 Group: System/Libraries License: Apache-2.0