Set volume vconf in dbus method hander instead of libmm-sound 20/136920/6 accepted/tizen/unified/20170717.021041 submit/tizen/20170713.021221
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 3 Jul 2017 12:27:15 +0000 (21:27 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Wed, 12 Jul 2017 13:28:19 +0000 (22:28 +0900)
[Version] 5.0.159
[Issue Type] Enhancement

Change-Id: Id3b0e678b63014932c97ebfb25eeb9fe33129847

packaging/pulseaudio-modules-tizen.spec
src/stream-manager-dbus.c
src/stream-manager-volume-priv.h
src/stream-manager-volume.c

index 618ed88519aa0c1084270bf64032ab20ddbdc39f..ab1a50febf2c1dfdd45e0715eb62a33c272c9c7c 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.158
+Version:          5.0.159
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 06569a62aa80ca4f03b3eb8d1ff15b13fd514c59..7830acb32c8b7fd42a1169ed9e5d71996a148065 100644 (file)
@@ -578,6 +578,12 @@ static void handle_set_volume_level(DBusConnection *conn, DBusMessage *msg, void
         goto finish;
     }
 
+    /* check vconf update here, volume will not be set if update fails */
+    if ((ret = update_volume_vconf(type, level))) {
+        pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
+        goto finish;
+    }
+
     if ((ret = set_volume_level_by_type(m, stream_type, type, level)))
         pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[RET_MSG_ERROR_INTERNAL], DBUS_TYPE_INVALID));
     else
@@ -1367,4 +1373,4 @@ void deinit_dbus(pa_stream_manager *m) {
 #endif
 }
 
-#endif
\ No newline at end of file
+#endif
index 4287ec729099d2d352e760165497369209aea966..8d9dc79c4a0a16a1dd6615cbcfd87bde49925b9d 100644 (file)
@@ -47,5 +47,6 @@ int32_t get_volume_mute_by_type(pa_stream_manager *m, stream_type_t stream_type,
 int32_t set_volume_mute_by_idx(pa_stream_manager *m, stream_type_t stream_type, uint32_t stream_idx, bool volume_mute);
 int32_t set_volume_mute_with_new_data(pa_stream_manager *m, void *stream, stream_type_t stream_type, bool volume_mute);
 int32_t get_volume_mute_by_idx(pa_stream_manager *m, stream_type_t stream_type, uint32_t stream_idx, bool *volume_mute);
+int32_t update_volume_vconf(const char *type, unsigned int value);
 
 #endif
index f28c388e3bcb44474270b2440e30a33f521d2a1a..8a7cb4ab4c04481a988c2397c49048d8e3c625c6 100644 (file)
@@ -227,6 +227,24 @@ static int get_volume_value(pa_stream_manager *m, stream_type_t stream_type, boo
     return 0;
 }
 
+int32_t update_volume_vconf(const char *type, unsigned int value)
+{
+    char str[128];
+
+    pa_snprintf(str, sizeof(str), "%s%s", VCONFKEY_OUT_VOLUME_PREFIX, type);
+
+    /* Set volume value to VCONF */
+    if ((vconf_set_int(str, value)) != 0) {
+        pa_log_error("vconf_set_int(%s) failed...errno(%d)",
+                     str, vconf_get_ext_errno());
+        return -1;
+    }
+
+    pa_log_info("volume set type(%s) value(%d)", str, value);
+
+    return 0;
+}
+
 int32_t set_volume_level_by_type(pa_stream_manager *m, stream_type_t stream_type, const char *volume_type, uint32_t volume_level) {
     bool is_hal_volume = false;
     volume_info *v = NULL;