merge from tizen_2.4 81/45281/2 accepted/tizen/mobile/20150806.134833 accepted/tizen/tv/20150806.134844 submit/tizen_mobile/20150806.080835 submit/tizen_tv/20150806.081029
authorjiseob.jang <jiseob.jang@samsung.com>
Tue, 4 Aug 2015 10:18:23 +0000 (19:18 +0900)
committerjiseob.jang <jiseob.jang@samsung.com>
Tue, 4 Aug 2015 10:26:57 +0000 (19:26 +0900)
Change-Id: I3b0b5addec4ae5b1b708e7b443403c70f670ce26
Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
CMakeLists.txt
packaging/account-manager.spec
packaging/accounts-service.service [deleted file]
server/src/account-server-db.c

index 6d4b164..f9a03f0 100644 (file)
@@ -5,7 +5,5 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
 SET(LIBDIR "\${prefix}/lib")
 SET(INCLUDEDIR "\${prefix}/include ")
-SET(VERSION_MAJOR 0)
-SET(VERSION "${VERSION_MAJOR}.0.1")
 
 ADD_SUBDIRECTORY(server)
index 2c5f6e6..d17cc6c 100644 (file)
@@ -1,14 +1,13 @@
 
 Name:       account-manager
 Summary:    Account Manager
-Version:    0.0.1
+Version:    0.0.4
 Release:    1
 Group:      Social & Content/Other
 License:    Apache-2.0
 Source0:    account-manager-%{version}.tar.gz
-Source1:    accounts-service.service
-Source2:    org.tizen.account.manager.service
-Source3:       org.tizen.account.manager.conf
+Source1:    org.tizen.account.manager.service
+Source2:    org.tizen.account.manager.conf
 
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(dlog)
@@ -34,7 +33,7 @@ Account Daemon: no
 
 %prep
 %setup -q
-cp %{SOURCE2} .
+cp %{SOURCE1} .
 
 %build
 #export   CFLAGS+=" -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default"
@@ -55,18 +54,13 @@ make %{?jobs:-j%jobs}
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
-install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/accounts-service.service
-#ln -s ../accounts-service.service %{buildroot}%{_unitdir}/default.target.wants/accounts-service.service
-ln -s ../accounts-service.service %{buildroot}%{_unitdir}/multi-user.target.wants/accounts-service.service
-
-#rm -rf %{buildroot}/usr/lib/account-manager
+rm -rf %{buildroot}/usr/lib/account-manager
 
 mkdir -p %{buildroot}/usr/share/dbus-1/system-services
-install -m 0644 %SOURCE2 %{buildroot}/usr/share/dbus-1/system-services/org.tizen.account.manager.service
+install -m 0644 %SOURCE1 %{buildroot}/usr/share/dbus-1/system-services/org.tizen.account.manager.service
 
 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
-install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/dbus-1/system.d/
+install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/dbus-1/system.d/
 
 %post
 /sbin/ldconfig
@@ -97,6 +91,9 @@ chown system:system %{TZ_SYS_DB}/.account.db-journal
 chmod 600 %{TZ_SYS_DB}/.account.db
 chmod 600 %{TZ_SYS_DB}/.account.db-journal
 
+#smack labeling
+chsmack -a 'System' %{TZ_SYS_DB}/.account.db-journal
+chsmack -a 'System' %{TZ_SYS_DB}/.account.db
 %postun -p /sbin/ldconfig
 
 
@@ -105,8 +102,5 @@ chmod 600 %{TZ_SYS_DB}/.account.db-journal
 %defattr(-,system,system,-)
 %config %{_sysconfdir}/dbus-1/system.d/org.tizen.account.manager.conf
 %{_bindir}/account-svcd
-%{_unitdir}/accounts-service.service
-%{_unitdir}/multi-user.target.wants/accounts-service.service
-#%attr(-,root,root) %{_unitdir}/default.target.wants/accounts-service.service
-/usr/share/dbus-1/system-services/org.tizen.account.manager.service
+%attr(0644,system,system) /usr/share/dbus-1/system-services/org.tizen.account.manager.service
 
diff --git a/packaging/accounts-service.service b/packaging/accounts-service.service
deleted file mode 100644 (file)
index 863afaf..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Accounts service
-
-[Service]
-User=system
-Group=system
-Type=simple
-ExecStart=/usr/bin/account-svcd
-
-[Install]
-WantedBy=multi-user.target
index 7c5926e..43c5443 100644 (file)
@@ -48,7 +48,7 @@ typedef sqlite3_stmt* account_stmt;
 
 #define RCS_APPID "com.samsung.rcs-im"
 #define IMS_SERVICE_APPID "ims-service"
-#define ACTIVESYNC_APPID "activesync-ui"
+#define ACTIVESYNC_APPID "eas-ui"
 #define EMAIL_APPID "email-setting-efl"
 #define SYNCHRONISE_APPID "setting-synchronise-efl"
 #define DS_AGENT_CMDLINE "/usr/bin/oma-ds-agent"
@@ -56,6 +56,9 @@ typedef sqlite3_stmt* account_stmt;
 #define FACEBOOK_SDK_APPID "com.samsung.facebook-service"
 #define FACEBOOK_APPID "com.samsung.facebook"
 
+#define EASYSIGNUP_CMDLINE     "/usr/bin/esu-agent"
+#define EASYSIGNUP_APPID       "com.samsung.esu-agent"
+
 #define ACCOUNT_DB_OPEN_READONLY 0
 #define ACCOUNT_DB_OPEN_READWRITE 1
 
@@ -201,6 +204,10 @@ static char* _account_get_current_appid(int pid)
                        appid_ret = _account_get_text(SYNCHRONISE_APPID);
                        _ACCOUNT_FREE(cmdline);
                        return appid_ret;
+               } else if (!g_strcmp0(cmdline, EASYSIGNUP_CMDLINE)) {
+                       appid_ret = _account_get_text(EASYSIGNUP_APPID);
+                       _ACCOUNT_FREE(cmdline);
+                       return appid_ret;
                } else {
                        ACCOUNT_DEBUG("No app id\n");
                        _ACCOUNT_FREE(cmdline);
@@ -258,6 +265,11 @@ static int _account_check_account_type_with_appid_group(const char* appid, char*
                return ACCOUNT_ERROR_NONE;
        }
 
+       if(!strcmp(appid, EASYSIGNUP_APPID)){
+               ACCOUNT_DEBUG("easysignup exception\n");
+               *verified_appid = _account_get_text(appid);
+               return ACCOUNT_ERROR_NONE;
+       }
        /* Get app id family which is stored in account database */
        int pkgmgr_ret = -1;
        pkgmgr_ret = pkgmgrinfo_appinfo_get_appinfo(appid, &ahandle);
@@ -327,11 +339,16 @@ static int _account_check_appid_group_with_package_name(const char* appid, char*
        }
 
        /* ims-service Exception */
-       if ( strcmp(appid, "ims-service") == 0 &&       strcmp(package_name, "ims-service") == 0 ) {
+       if ( strcmp(appid, IMS_SERVICE_APPID) == 0 &&   strcmp(package_name, IMS_SERVICE_APPID) == 0 ) {
                ACCOUNT_DEBUG("ims exception.");                                // TODO: NEED TO REMOVE, debug log.
                return ACCOUNT_ERROR_NONE;
        }
 
+       /* easysignup Exception */
+       if ( strcmp(appid, EASYSIGNUP_APPID) == 0 &&    strcmp(package_name, EASYSIGNUP_APPID) == 0 ) {
+               ACCOUNT_DEBUG("easysignup exception.");                         // TODO: NEED TO REMOVE, debug log.
+               return ACCOUNT_ERROR_NONE;
+       }
        /* Get app id family which is stored in account database */
        int pkgmgr_ret = -1;
        pkgmgr_ret = pkgmgrinfo_appinfo_get_appinfo(appid, &ahandle);
@@ -361,7 +378,7 @@ static int _account_check_appid_group_with_package_name(const char* appid, char*
                                _ACCOUNT_FREE(tmp);
                                break;
                        } else if ( strcmp(tmp, "com.samsung.samsung-account-front") == 0 &&
-                                               strcmp(package_name, "gr47by21a5.SamsungAccount") == 0 ) {
+                                               strcmp(package_name, "com.samsung.samsungaccount") == 0 ) {
                                /* Samung Account Exception */
                                error_code = ACCOUNT_ERROR_NONE;
                                _ACCOUNT_FREE(tmp);