Add multi-user support 17/17017/1 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi tizen_3.0.2014.q3_common tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.m14.2_ivi tizen_3.0.m14.3_ivi tizen_3.0_ivi submit/tizen_common/20140521.163740 submit/tizen_common/20140522.130648 submit/tizen_common/20140522.135644 submit/tizen_ivi/20140618.000000 submit/tizen_ivi/20140618.000001 submit/tizen_ivi/20140619.000000 submit/tizen_ivi/20140622.000000 submit/tizen_ivi/20140623.000000 submit/tizen_ivi/20140624.064036 submit/tizen_ivi/20140626.125712 submit/tizen_ivi/20140626.130032 submit/tizen_ivi/20140626.144348 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.2_ivi_release tizen_3.0.m14.3_ivi_release tizen_3.0_ivi_release
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Mon, 27 Jan 2014 15:41:10 +0000 (16:41 +0100)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Fri, 28 Feb 2014 13:59:28 +0000 (14:59 +0100)
/opt/usr/voice/ purpose was to stock user's downloaded engines and
associated settings. It has been moved to ~/.voice/ to respect the
multi-user architecture.

Also set valid group tags.

Bug-Tizen: PTREL-292
Change-Id: Ib0f8679733b950a76e3e5ddef69568c029c6e805
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
CMakeLists.txt
packaging/stt.spec
server/sttd_config.c
server/sttd_engine_agent.c
server/sttd_main.h

index 4d1532e..35c7f5d 100755 (executable)
@@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/common")
 ## Dependent packages ##
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED 
-       glib-2.0 dbus-1 vconf dlog ecore ecore-file capi-media-audio-io capi-media-sound-manager
+       glib-2.0 dbus-1 vconf dlog ecore ecore-file capi-media-audio-io capi-media-sound-manager libtzplatform-config
 )
 
 ## Client library ##
index 04d8cec..ccb224a 100755 (executable)
@@ -1,12 +1,12 @@
 Name:       stt
 Summary:    Speech To Text client library and daemon
 Version:    0.1.41
-Release:    1
-Group:      UI Framework/Libraries
+Release:    0
+Group:      Graphics & UI Framework/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
-Source1001:    %{name}.manifest
-Source1002:    %{name}-devel.manifest
+Source1001: %{name}.manifest
+Source1002: %{name}-devel.manifest
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(ecore)
@@ -15,7 +15,7 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(capi-media-audio-io)
 BuildRequires:  pkgconfig(capi-media-sound-manager)
-
+BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  cmake
 
 %description
@@ -24,7 +24,7 @@ Speech To Text client library and daemon.
 
 %package devel
 Summary:    Speech To Text header files for STT development
-Group:      Development/UI Framework
+Group:      Graphics & UI Framework/Development
 Requires:   %{name} = %{version}-%{release}
 
 %description devel
@@ -51,7 +51,7 @@ rm -rf %{buildroot}
 %files
 %manifest %{name}.manifest
 %license LICENSE.APLv2
-/etc/config/sysinfo-stt.xml
+%config %{_sysconfdir}/config/sysinfo-stt.xml
 %defattr(-,root,root,-)
 %{_libdir}/libstt.so
 %{_libdir}/libstt_setting.so
index 377ae29..4632c3c 100644 (file)
 */
 
 #include <Ecore_File.h>
+
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #include "sttd_main.h"
 #include "sttd_config.h"
 
 
-#define CONFIG_FILE_PATH       CONFIG_DIRECTORY"/sttd.conf"
+#define CONFIG_FILE_PATH       tzplatform_mkpath(TZ_USER_HOME, ".voice/sttd.conf")
 #define CONFIG_DEFAULT         BASE_DIRECTORY_DEFAULT"/sttd.conf"
 
 #define ENGINE_ID      "ENGINE_ID"
index acd1ef6..cba5e96 100644 (file)
@@ -513,7 +513,7 @@ int __internal_update_engine_list()
                                strncat(filepath, dirp->d_name, strlen(dirp->d_name) );
                        } else {
                                SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Memory not enough!!" );
-                               continue;       
+                               continue;
                        }
 
                        /* get its info and update engine list */
index 3245197..0ce3bd9 100644 (file)
@@ -24,6 +24,9 @@
 #include <dlog.h>
 #include <errno.h>
 
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -38,10 +41,10 @@ extern "C" {
 #define ENGINE_DIRECTORY_DEFAULT               "/usr/lib/voice/stt/1.0/engine"
 #define ENGINE_DIRECTORY_DEFAULT_SETTING       "/usr/lib/voice/stt/1.0/setting"
 
-#define CONFIG_DIRECTORY                       "/opt/home/app/.voice"
+#define CONFIG_DIRECTORY                       tzplatform_mkpath(TZ_USER_HOME, ".voice")
 
-#define ENGINE_DIRECTORY_DOWNLOAD              "/opt/usr/voice/stt/1.0/engine"
-#define ENGINE_DIRECTORY_DOWNLOAD_SETTING      "/opt/usr/voice/stt/1.0/setting"
+#define ENGINE_DIRECTORY_DOWNLOAD              tzplatform_mkpath(TZ_USER_HOME, ".voice/stt/1.0/engine")
+#define ENGINE_DIRECTORY_DOWNLOAD_SETTING      tzplatform_mkpath(TZ_USER_HOME, ".voice/stt/1.0/setting")
 
 /* for debug message */
 #define RECORDER_DEBUG