Fix error for sound for media volume change 84/253184/1 accepted/tizen/unified/20210208.032140 submit/tizen/20210205.083208
authorkiso.chang <kiso.chang@samsung.com>
Fri, 5 Feb 2021 08:11:53 +0000 (17:11 +0900)
committerkiso.chang <kiso.chang@samsung.com>
Fri, 5 Feb 2021 08:15:31 +0000 (17:15 +0900)
- do not make sound for media volume change when music is playing

Change-Id: Iffbce2c24c0752a69a17a62ee099e21825a169c9
Signed-off-by: kiso.chang <kiso.chang@samsung.com>
setting-profile/src/setting-profile-sound-main.c

index 9ab8aa2630660be7da6f1dc0f37a726895f4efff..ea64d075db124714eabd412b9eb4c4703f232c4b 100755 (executable)
@@ -293,7 +293,6 @@ static void _noti_slider_change_cb(
 static void _media_slider_change_cb(
                void *data, Evas_Object *obj, void *event_info)
 {
-       char *pa_tone_path = NULL;
        player_state_e state = PLAYER_STATE_NONE;
        sound_type_e sound_type = SOUND_TYPE_MEDIA;
        SETTING_TRACE_BEGIN;
@@ -340,18 +339,23 @@ static void _media_slider_change_cb(
 
        if (state == PLAYER_STATE_IDLE) {
                if (list_item->chk_status > 0) {
-                       if (isEmulBin())
-                               pa_tone_path = strdup(SETTING_DEFAULT_CALL_TONE_SDK);
-                       else
-                               pa_tone_path = strdup(SETTING_DEFAULT_MEDIA_TONE);
-
-                       setting_sound_play_sound_origin(
-                                       ad,
-                                       NULL,
-                                       pa_tone_path,
-                                       (float)list_item->chk_status,
-                                       sound_type);
-                       FREE(pa_tone_path);
+                       sound_type_e type;
+                       int ret =  sound_manager_get_current_sound_type(&type);
+                       if (ret == SOUND_MANAGER_ERROR_NO_PLAYING_SOUND) {
+                               char *pa_tone_path = NULL;
+                               if (isEmulBin())
+                                       pa_tone_path = strdup(SETTING_DEFAULT_CALL_TONE_SDK);
+                               else
+                                       pa_tone_path = strdup(SETTING_DEFAULT_MEDIA_TONE);
+
+                               setting_sound_play_sound_origin(
+                                               ad,
+                                               NULL,
+                                               pa_tone_path,
+                                               (float)list_item->chk_status,
+                                               sound_type);
+                               FREE(pa_tone_path);
+                       }
                }
        } else {
                SETTING_TRACE("ringtone player status : %d", state);