Add sound_stop function 77/228277/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20200326.232352 accepted/tizen/5.5/unified/wearable/hotfix/20201027.112331 submit/tizen_5.5/20200326.054543 submit/tizen_5.5_wearable_hotfix/20201026.184304
authorYunmi Ha <yunmi.ha@samsung.com>
Thu, 19 Mar 2020 09:35:11 +0000 (18:35 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 20 Mar 2020 05:04:11 +0000 (05:04 +0000)
- When called this API, whole exist keytones will be stopped.

Change-Id: I5a11326e8b11f0e1e4532be615a0a84ed6fc6edd
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
(cherry picked from commit 159e87c34efdc51f463c4e92152f95918129dcdc)

src/sound.c

index 8e54a8d18b4a1124a7fb520be4a06f2383e0b0ab..886b707ed27ba4fd2d63903ebc1d262e6de64702 100644 (file)
@@ -219,6 +219,23 @@ static int sound_is_supported(feedback_pattern_e pattern, bool *supported)
        return 0;
 }
 
+static int sound_stop(void)
+{
+       int ret;
+
+       /**
+       * @param        filename        [in] keytone filename to stop (can be null if whole exist keytones needs stops)
+       * int mm_sound_stop_keysound(const char *filename);
+       */
+       ret = mm_sound_stop_keysound(NULL);
+       if (ret == MM_ERROR_NONE)       {
+               _D("stop success!");
+               return 0;
+       }
+       _E("mm_sound_stop_keysound() returned error(%d)", ret);
+       return ret;
+}
+
 //LCOV_EXCL_START Not used function
 static int sound_get_path(feedback_pattern_e pattern, char *buf, unsigned int buflen)
 {
@@ -311,6 +328,7 @@ static const struct device_ops sound_device_ops = {
        .init = sound_init,
        .exit = sound_exit,
        .play = sound_play,
+       .stop = sound_stop,
        .is_supported = sound_is_supported,
        .get_path = sound_get_path,
        .set_path = sound_set_path,