mm_sound_testsuite: give an option to use environment value for keytone playback 57/284257/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 14 Nov 2022 08:45:32 +0000 (17:45 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Mon, 14 Nov 2022 08:45:32 +0000 (17:45 +0900)
[Version] 0.13.22
[Issue Type] Tool

Change-Id: Iab7137fc13956ed35be793bfbaffb621d24b82bc

packaging/libmm-sound.spec
testsuite/mm_sound_testsuite_simple.c

index c7de560..0420af2 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and focus server binary
-Version:    0.13.21
+Version:    0.13.22
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index f3c07bf..ac5f147 100755 (executable)
@@ -48,6 +48,7 @@
 #define POWERON_FILE   "/usr/share/keysound/poweron.ogg"
 #define KEYTONE_FILE   "/usr/share/sounds/mm-sound/Tizen_HW_Touch.ogg"
 #define KEYTONE_NOTI_FILE      "/usr/share/sounds/alsa/Front_Center.wav"
+#define MM_SOUND_KEYTONE "MM_SOUND_KEYTONE"
 
 enum {
        CURRENT_STATUS_MAINMENU = 0,
@@ -557,7 +558,8 @@ static void interpret(char *cmd)
                        if (ret < 0)
                                debug_error("keysound stop failed with 0x%x", ret);
                } else if (strncmp(cmd, "k", 1) == 0) {
-                       ret = mm_sound_play_keysound(KEYTONE_FILE, 0);
+                       char* env_keytone_path = getenv(MM_SOUND_KEYTONE);
+                       ret = mm_sound_play_keysound(env_keytone_path ? env_keytone_path : KEYTONE_FILE, 0);
                        if (ret < 0)
                                debug_error("keysound play failed with 0x%x", ret);
                } else if (strncmp(cmd, "q", 1) == 0) {