Fix dbus bug about conn block 91/50291/2
authorky85.kim <ky85.kim@samsung.com>
Tue, 27 Oct 2015 12:17:40 +0000 (21:17 +0900)
committerky85.kim <ky85.kim@samsung.com>
Tue, 27 Oct 2015 12:41:12 +0000 (21:41 +0900)
Change-Id: I0deb6ab7bc797b31aba8bf10a2b1108a112982d1

CMakeLists.txt
client/vc_mgr_dbus.c
common/vc_defs.h
org.tizen.voice.vcserver.service
packaging/voice-control.spec
server/vcd_dbus.c
vc-server.conf

index 67782d9..46927e8 100644 (file)
@@ -28,9 +28,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "${PREFIX}")
 SET(VERSION 0.2.10)
 
-IF (LIBDIR MATCHES "/usr/lib64")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLIB64")
-ENDIF (LIBDIR)
+ADD_DEFINITIONS("-DVOICE_LIBDIR=\"${LIBDIR}\"")
 
 # pkg config tool
 INCLUDE(FindPkgConfig)
@@ -59,3 +57,5 @@ ADD_SUBDIRECTORY(server)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/vc-config.xml DESTINATION /usr/share/voice/vc/)
 
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.vcserver.service DESTINATION /usr/share/dbus-1/services)
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/vc-server.conf DESTINATION /etc/dbus-1/session.d)
\ No newline at end of file
index 9fc3a09..f25cc8a 100644 (file)
@@ -428,7 +428,7 @@ int vc_mgr_dbus_open_connection()
        dbus_error_init(&err);
 
        /* connect to the DBUS system bus, and check for errors */
-       g_m_conn_sender = dbus_bus_get(DBUS_BUS_SESSION, &err);
+       g_m_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
 
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, TAG_VCM, "Dbus Connection Error (%s)", err.message);
@@ -441,7 +441,7 @@ int vc_mgr_dbus_open_connection()
        }
 
        /* connect to the DBUS system bus, and check for errors */
-       g_m_conn_listener = dbus_bus_get(DBUS_BUS_SESSION, &err);
+       g_m_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
 
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, TAG_VCM, "Dbus Connection Error (%s)", err.message);
index 5dd3300..79e15b9 100644 (file)
@@ -145,11 +145,7 @@ extern "C" {
 #define VC_CONFIG_BASE                 tzplatform_mkpath(TZ_USER_HOME, "share/.voice")
 #define VC_CONFIG                      tzplatform_mkpath(TZ_USER_HOME, "share/.voice/vc-config.xml")
 
-#ifdef LIB64
-#define VC_DEFAULT_ENGINE_INFO         "/usr/lib64/voice/vc/1.0/engine-info"
-#else
-#define VC_DEFAULT_ENGINE_INFO         "/usr/lib/voice/vc/1.0/engine-info"
-#endif
+#define VC_DEFAULT_ENGINE_INFO         VOICE_LIBDIR"/voice/vc/1.0/engine-info"
 
 #define VC_NO_FOREGROUND_PID           0
 
index 6fd1b9b..a6f1e01 100644 (file)
@@ -1,4 +1,3 @@
 [D-BUS Service]
 Name=org.tizen.voice.vcserver
 Exec=/usr/bin/vc-daemon
-
index 575da96..8ebf9da 100644 (file)
@@ -111,6 +111,7 @@ mkdir -p /usr/share/voice/vc
 %{_libdir}/libvc_manager.so
 %{_bindir}/vc-daemon
 /usr/share/dbus-1/services/org.tizen.voice*
+/etc/dbus-1/session.d/vc-server.conf
 /usr/share/voice/vc/vc-config.xml
 /usr/share/license/%{name}
 
index 49f5fa7..0b03140 100644 (file)
@@ -174,6 +174,7 @@ int vcdc_send_set_volume(int manger_pid, float volume)
 
        if (1 != dbus_connection_send(g_conn_sender, msg, NULL)) {
                SLOG(LOG_ERROR, TAG_VCD, "[Dbus ERROR] Fail to Send");
+               dbus_message_unref(msg);
                return -1;
        } else {
                SLOG(LOG_DEBUG, TAG_VCD, "<<<< Send set volume : pid(%d), volume(%f)", manger_pid, volume);
@@ -528,7 +529,7 @@ int vcd_dbus_open_connection()
        int ret;
 
        /* Create connection for sender */
-       g_conn_sender = dbus_bus_get(DBUS_BUS_SESSION, &err);
+       g_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
 
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, TAG_VCD, "[Dbus ERROR] Fail dbus_bus_get : %s", err.message);
@@ -541,7 +542,7 @@ int vcd_dbus_open_connection()
        }
 
        /* connect to the bus and check for errors */
-       g_conn_listener = dbus_bus_get(DBUS_BUS_SESSION, &err);
+       g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
 
        if (dbus_error_is_set(&err)) {
                SLOG(LOG_ERROR, TAG_VCD, "[Dbus ERROR] Fail dbus_bus_get : %s", err.message);
index ded4aef..58c306e 100644 (file)
@@ -3,95 +3,46 @@
 <busconfig>
 
 <!-- root can own the service -->
-  <policy user="default">
-    <allow own_prefix="org.tizen.voice.vcclient"/>
-    <allow send_destination="org.tizen.voice.vcclient"/>
-    <allow receive_sender="org.tizen.voice.vcclient"/>
-  </policy>
-
   <policy user="root">
     <allow own_prefix="org.tizen.voice.vcclient"/>
     <allow send_destination="org.tizen.voice.vcclient"/>
     <allow receive_sender="org.tizen.voice.vcclient"/>
   </policy>
-
   <policy context="default">
     <allow own_prefix="org.tizen.voice.vcclient"/>
     <allow send_destination="org.tizen.voice.vcclient"/>
     <allow receive_sender="org.tizen.voice.vcclient"/>
   </policy>
-
   
-  <policy user="default">
-    <allow own_prefix="org.tizen.voice.vcwidget"/>
-    <allow send_destination="org.tizen.voice.vcwidget"/>
-    <allow receive_sender="org.tizen.voice.vcwidget"/>
-  </policy>
-
   <policy user="root">
     <allow own_prefix="org.tizen.voice.vcwidget"/>
     <allow send_destination="org.tizen.voice.vcwidget"/>
     <allow receive_sender="org.tizen.voice.vcwidget"/>
   </policy>
-
   <policy context="default">
     <allow own_prefix="org.tizen.voice.vcwidget"/>
     <allow send_destination="org.tizen.voice.vcwidget"/>
     <allow receive_sender="org.tizen.voice.vcwidget"/>
   </policy>
 
-    
-  <policy user="default">
-    <allow own_prefix="org.tizen.voice.vcmanager"/>
-    <allow send_destination="org.tizen.voice.vcmanager"/>
-    <allow receive_sender="org.tizen.voice.vcmanager"/>
-  </policy>
-
   <policy user="root">
     <allow own_prefix="org.tizen.voice.vcmanager"/>
     <allow send_destination="org.tizen.voice.vcmanager"/>
     <allow receive_sender="org.tizen.voice.vcmanager"/>
   </policy>
-
   <policy context="default">
     <allow own_prefix="org.tizen.voice.vcmanager"/>
     <allow send_destination="org.tizen.voice.vcmanager"/>
     <allow receive_sender="org.tizen.voice.vcmanager"/>
   </policy>
-    
-
-  <policy user="default">
-    <allow own="org.tizen.voice.vcserver"/>
-    <allow send_destination="org.tizen.voice.vcserver"/>
-    <allow receive_sender="org.tizen.voice.vcserver"/>
-  </policy>
 
   <policy user="root">
     <allow own="org.tizen.voice.vcserver"/>
     <allow send_destination="org.tizen.voice.vcserver"/>
     <allow receive_sender="org.tizen.voice.vcserver"/>
   </policy>
-  
-  <policy user="system">
-    <allow own="org.tizen.voice.vcserver"/>
-    <allow send_destination="org.tizen.voice.vcserver"/>
-    <allow receive_sender="org.tizen.voice.vcserver"/>
-  </policy>
-  
-  
-  <!--
-  <policy context="default">
-    <check send_destination="org.tizen.voice.vcserver"
-    send_interface="org.tizen.voice.vcserver"
-    privilege="(n/a)" />
-  </policy>
-  -->
-  
-  <!--
   <policy context="default">
-    <check send_destination="org.tizen.voice.vcserver"
-    send_interface="org.tizen.voice.vcserver"
-    privilege="http://tizen.org/privilege/recorder" />
+    <allow send_destination="org.tizen.voice.vcserver"
+           send_interface="org.tizen.voice.vcserver"/>
   </policy>
-  -->
 </busconfig>