N_SE-39533 account_delete_from_db_by_package_name notification issue fix
authorsckim <sungchan81.kim@samsung.com>
Wed, 29 May 2013 10:13:42 +0000 (19:13 +0900)
committersckim <sungchan81.kim@samsung.com>
Wed, 29 May 2013 10:13:42 +0000 (19:13 +0900)
Change-Id: I5345a4a19a4ed3ceea8be72eeb388a25f56f8e66

CMakeLists.txt
accounts-svc.pc.in
include/account.h
libaccounts-svc.manifest
packaging/libaccounts-svc.spec
src/account-capability-parser.c [deleted file]
src/account-xml-verify.c [deleted file]
src/account.c

index 875f58e..4376cc7 100755 (executable)
@@ -6,29 +6,16 @@ SET(EXEC_PREFIX "\${prefix}")
 SET(LIBDIR "\${prefix}/lib")
 SET(INCLUDEDIR "\${prefix}/include ")
 SET(VERSION_MAJOR 0)
-SET(VERSION "${VERSION_MAJOR}.2.52")
+SET(VERSION "${VERSION_MAJOR}.2.65")
 
 SET(SRCS
 src/account.c
-src/account-capability-parser.c
-)
-
-SET(TESTSRC
-src/account.c
-src/account-capability-parser.c
-src/utc-account.c
-)
-
-SET(XML_PARSE_TEST_SRC
-src/account.c
-src/account-capability-parser.c
-src/account-xml-verify.c
 )
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED sqlite3 dlog db-util glib-2.0 capi-base-common vconf capi-appfw-application libxml-2.0 pkgmgr-info aul)
+pkg_check_modules(pkgs REQUIRED sqlite3 dlog db-util glib-2.0 capi-base-common vconf pkgmgr-info aul)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -55,14 +42,7 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
 
-ADD_EXECUTABLE("acctest" ${TESTSRC})
-
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
-TARGET_LINK_LIBRARIES("acctest" ${pkgs_LDFLAGS})
-
-ADD_EXECUTABLE("account-xml-verify" ${XML_PARSE_TEST_SRC})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
-TARGET_LINK_LIBRARIES("account-xml-verify" ${pkgs_LDFLAGS})
 
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 
@@ -70,8 +50,6 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib/accounts-svc)
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
 
-INSTALL(TARGETS account-xml-verify DESTINATION bin)
-
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account.h DESTINATION include)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account-error.h DESTINATION include)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account-types.h DESTINATION include)
index 3a1d283..12ef0c9 100755 (executable)
@@ -8,6 +8,6 @@ includedir=@INCLUDEDIR@
 Name: accounts-svc
 Description: Account DB library
 Version: @VERSION@
-Requires: sqlite3 dlog db-util glib-2.0 capi-base-common vconf capi-appfw-application libxml-2.0
+Requires: sqlite3 dlog db-util glib-2.0 capi-base-common vconf
 Libs: -L${libdir} -laccounts-svc
 Cflags: -I${includedir}
index dc34c38..f3ed6c4 100755 (executable)
@@ -247,7 +247,7 @@ ACCOUNT_API int account_delete_from_db_by_user_name(char *user_name, char *packa
  * @see account_update_to_db_by_id()
  * @see account_update_to_db_by_user_name()
  */
-ACCOUNT_API int account_delete_from_db_by_package_name(char *package_name);
+ACCOUNT_API int account_delete_from_db_by_package_name(const char *package_name);
 
 
 /**
@@ -1018,90 +1018,6 @@ ACCOUNT_API int account_get_total_count_from_db(int *count);
  */
 ACCOUNT_API int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status);
 
-/**
- * @brief      Called once for each service provider of account
- *
- * @param[in]  package_name package name of the service
- * @param[in]  icon_path icon path of the service
- * @param[in]  multiple if true supports multiple account else only one account support
- * @param[in]  user_data The user data passed from the account_query_service_list_by_capability function
- *
- * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop.
- *
- * @pre account_query_service_list_by_capability() invokes this callback.
- *
- * @see account_query_service_list_by_capability()
- */
-typedef bool (*service_list_cb)(char *package_name, char *icon_path, bool multiple, void *user_data);
-
-/**
- * @brief      Retrieves all services which supports specified capability.
- *
- * @param[in]  callback The callback function to invoke
- * @param[in]  capability_type The capablity type to search
- * @param[in]  user_data The user data to be passed to the callback function
- *
- * @return     0 on success, otherwise a negative error value.
- * @retval     #ACCOUNT_ERROR_NONE Successful
- * @retval     #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval     #ACCOUNT_ERROR_XML_PARSE_FAILED XML Parsing failed
- * @retval     #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- * @post       This function invokes service_list_cb().
- *
- */
-ACCOUNT_API int account_query_service_list_by_capability(service_list_cb callback, const char* capability_type, void *user_data);
-
-
-/**
- * @brief      Get whether application supports desired capability or not.
- *
- * @param[in]  package_name    The application's package name
- * @param[in]  capability_filter       which capability to check for
- * @param[out] supported               whether desired capability is supported, Returns true otherwise false
- *
- * @return     0 on success, otherwise a negative error value.
- * @retval     #ACCOUNT_ERROR_NONE Successful
- * @retval     #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval     #ACCOUNT_ERROR_XML_PARSE_FAILED  XML Parsing failed
- * @retval     #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- */
-ACCOUNT_API int account_get_application_capability_support(char *package_name, char *capability_filter, bool *supported);
-
-
-/**
- * @brief      Get whether application supports multiple accounts or not.
- *
- * @param[in]  package_name    The application's package name
- * @param[out] supported               if multiple account is supported returns true otherwise false
- *
- * @return     0 on success, otherwise a negative error value.
- * @retval     #ACCOUNT_ERROR_NONE Successful
- * @retval     #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval     #ACCOUNT_ERROR_XML_PARSE_FAILED  XML Parsing failed
- * @retval     #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- */
-ACCOUNT_API int account_get_application_multiple_account_support(char * package_name, bool * supported);
-
-/**
- * @brief      Get application's icon path.
- *
- * @remarks    @a icon_path must be released with free() by you.
- *
- * @param[in]  package_name    The application's package name
- * @param[out] icon_path               if path is availabe it will have icon_path, otherwise NULL
- *
- * @return     0 on success, otherwise a negative error value.
- * @retval     #ACCOUNT_ERROR_NONE Successful
- * @retval     #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval     #ACCOUNT_ERROR_XML_PARSE_FAILED  XML Parsing failed
- * @retval     #ACCOUNT_ERROR_XML_FILE_NOT_FOUND XML file not found
- *
- */
-ACCOUNT_API int account_get_application_icon_path(const char *package_name, char **icon_path);
-
 
 /* Account type API */
 
index 2de6d11..4d20ea8 100755 (executable)
@@ -13,6 +13,6 @@
        </request>
        <assign>
                <filesystem path="/usr/lib/libaccounts-svc.so.0" label="_" />
-               <filesystem path="/usr/lib/libaccounts-svc.so.0.2.52" label="_" />
+               <filesystem path="/usr/lib/libaccounts-svc.so.0.2.65" label="_" />
        </assign>
 </manifest>
index 3bed036..0696c49 100755 (executable)
@@ -1,7 +1,7 @@
 
 Name:       libaccounts-svc
 Summary:    Account DB library
-Version:    0.2.52
+Version:    0.2.65
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    Apache-2.0
@@ -13,8 +13,6 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(db-util)
 BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(vconf)
-BuildRequires:  pkgconfig(capi-appfw-application)
-BuildRequires:  pkgconfig(libxml-2.0)
 BuildRequires:  pkgconfig(pkgmgr-info)
 BuildRequires:  pkgconfig(aul)
 Requires(post): /sbin/ldconfig
@@ -94,11 +92,9 @@ fi
 %manifest libaccounts-svc.manifest
 %defattr(-,root,root,-)
 %{_libdir}/*.so.*
-%{_bindir}/account-xml-verify
 
 %files devel
 %defattr(-,root,root,-)
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/accounts-svc.pc
 %{_includedir}/*.h
-%{_bindir}/account-xml-verify
diff --git a/src/account-capability-parser.c b/src/account-capability-parser.c
deleted file mode 100755 (executable)
index 97d44c3..0000000
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- *  account
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Sungchan Kim <sungchan81.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <account.h>
-#include <glib.h>
-#include <account-private.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <app.h>
-
-#ifndef ACCOUNT_API
-#define ACCOUNT_API __attribute__ ((visibility("default")))
-#endif
-
-#define ACCOUNT_XML_DIR "/usr/share/account"
-#define ACCOUNT_XML_OPT_DIR "/opt/usr/share/account"
-#define BUFSIZE 1024
-
-static void _account_parse_doc(xmlDocPtr doc, xmlNodePtr cur,
-                                                       char *capability_filter, bool *supported)
-{
-       xmlChar *key;
-       cur = cur->xmlChildrenNode;
-       while ((cur != NULL) && (*supported != true)) {
-               if ((!xmlStrcmp(cur->name, (const xmlChar *)"capability"))) {
-                       key = xmlNodeGetContent(cur);
-                       ACCOUNT_DEBUG("Capability String is : %s\n", key);
-                       if (!strcmp(capability_filter, (char *)key)) {
-                               *supported = true;
-                       }
-                       xmlFree(key);
-               }
-       cur = cur->next;
-       }
-       return;
-}
-
-static bool _account_check_file_exists(char *f_path)
-{
-       FILE *file;
-       if ((file = fopen(f_path, "r")) != NULL) {
-               fclose(file);
-               return TRUE;
-       }
-       return FALSE;
-}
-
-ACCOUNT_API int account_get_application_capability_support(char *package_name,
-                                                               char *capability_filter, bool *supported)
-{
-       if (!package_name) {
-               ACCOUNT_ERROR("package_name can not be NULL \n");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!capability_filter) {
-               ACCOUNT_ERROR("capability_filter can not be NULL \n");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!supported) {
-               ACCOUNT_ERROR("supported pointer can not be NULL \n");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       char    xml_file_path[BUFSIZE] = {0, };
-       xmlDocPtr doc = NULL;
-       xmlNodePtr cur = NULL;
-       *supported = false;
-
-       ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
-       ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
-                                                       ACCOUNT_XML_DIR, package_name);
-
-       ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
-       if (!_account_check_file_exists(xml_file_path)) {
-               ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-
-               /*Check if file exists in /opt directory*/
-               ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
-               ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
-                                                               ACCOUNT_XML_OPT_DIR, package_name);
-
-               ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
-               if (!_account_check_file_exists(xml_file_path)) {
-                       ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-               return ACCOUNT_ERROR_XML_FILE_NOT_FOUND;
-       }
-       }
-
-       doc = xmlParseFile(xml_file_path);
-       if (doc == NULL ) {
-               ACCOUNT_ERROR("Document not parsed successfully. \n");
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-
-       cur = xmlDocGetRootElement(doc);
-       if (cur == NULL) {
-               ACCOUNT_ERROR("empty document\n");
-               xmlFreeDoc(doc);
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-
-       if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
-               ACCOUNT_ERROR("document of the wrong type, root node != account");
-               xmlFreeDoc(doc);
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-       _account_parse_doc(doc, cur, capability_filter, supported);
-       xmlFreeDoc(doc);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_application_multiple_account_support(
-                                                               char *package_name,
-                                                               bool *supported)
-{
-       if (!package_name) {
-               ACCOUNT_ERROR("package_name can not be NULL \n");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!supported) {
-               ACCOUNT_ERROR("supported pointer can not be NULL \n");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       char    xml_file_path[BUFSIZE] = {0, };
-       xmlDocPtr doc = NULL;
-       xmlNodePtr cur = NULL;
-       xmlChar *attr = NULL;
-       *supported = false;
-
-       ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
-       ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
-                                                       ACCOUNT_XML_DIR, package_name);
-
-       ACCOUNT_VERBOSE("xml_file_path = %s \n",xml_file_path);
-
-       if (!_account_check_file_exists(xml_file_path)) {
-               ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-
-               /*Check if file exists in /opt directory*/
-               ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
-               ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
-                                                               ACCOUNT_XML_OPT_DIR, package_name);
-
-               ACCOUNT_VERBOSE("xml_file_path = %s \n",xml_file_path);
-
-               if (!_account_check_file_exists(xml_file_path)) {
-                       ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-               return ACCOUNT_ERROR_XML_FILE_NOT_FOUND;
-       }
-       }
-
-       doc = xmlParseFile(xml_file_path);
-       if (doc == NULL ) {
-               ACCOUNT_ERROR("Document not parsed successfully. \n");
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-
-       cur = xmlDocGetRootElement(doc);
-       if (cur == NULL) {
-               ACCOUNT_ERROR("empty document\n");
-               xmlFreeDoc(doc);
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-
-       if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
-               ACCOUNT_ERROR("document of the wrong type, root node != account");
-               xmlFreeDoc(doc);
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-       attr = xmlGetProp(cur, (const xmlChar *)"multiple");
-       ACCOUNT_INFO("Multiple = %s \n",(char *)attr);
-
-       if (attr == NULL)
-               *supported = false;
-       else if (!strcmp("false", (char *)attr))
-               *supported = false;
-       else if (!strcmp("true", (char *)attr))
-               *supported = true;
-       else
-               *supported = false;
-
-       xmlFreeDoc(doc);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-ACCOUNT_API int account_get_application_icon_path(const char *package_name,
-                                                                                       char **icon_path)
-{
-       if (!package_name) {
-               ACCOUNT_ERROR("package_name can not be NULL \n");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       if (!icon_path) {
-               ACCOUNT_ERROR("icon_path pointer can not be NULL \n");
-               return ACCOUNT_ERROR_INVALID_PARAMETER;
-       }
-       char    xml_file_path[BUFSIZE] = {0, };
-       xmlDocPtr doc = NULL;
-       xmlNodePtr cur = NULL;
-       xmlChar *attr = NULL;
-       *icon_path = NULL;
-
-       ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
-       ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
-                                                       ACCOUNT_XML_DIR, package_name);
-
-       ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
-       if (!_account_check_file_exists(xml_file_path)) {
-               ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-
-               /*Check if file exists in /opt directory*/
-               ACCOUNT_MEMSET(xml_file_path, 0, sizeof(xml_file_path));
-               ACCOUNT_SNPRINTF(xml_file_path, BUFSIZE, "%s/%s.account.xml",
-                                                               ACCOUNT_XML_OPT_DIR, package_name);
-
-               ACCOUNT_INFO("xml_file_path = %s \n",xml_file_path);
-
-               if (!_account_check_file_exists(xml_file_path)) {
-                       ACCOUNT_ERROR("XML file not found for %s \n", package_name);
-               return ACCOUNT_ERROR_XML_FILE_NOT_FOUND;
-       }
-       }
-
-       doc = xmlParseFile(xml_file_path);
-       if (doc == NULL ) {
-               ACCOUNT_ERROR("Document not parsed successfully. \n");
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-
-       cur = xmlDocGetRootElement(doc);
-       if (cur == NULL) {
-               ACCOUNT_ERROR("empty document\n");
-               xmlFreeDoc(doc);
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-
-       if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
-               ACCOUNT_ERROR("document of the wrong type, root node != account");
-               xmlFreeDoc(doc);
-               return ACCOUNT_ERROR_XML_PARSE_FAILED;
-       }
-       attr = xmlGetProp(cur, (const xmlChar *)"icon_path");
-       ACCOUNT_DEBUG("icon_path = %s \n",(char *)attr);
-
-       if (attr == NULL)
-               *icon_path = NULL;
-       else
-               *icon_path = strdup((char *)attr);
-
-       xmlFreeDoc(doc);
-
-       return ACCOUNT_ERROR_NONE;
-}
-
-static bool __service_iter_func(service_h service, const char* pkg_name,
-                                                               void *data)
-{
-       if (!pkg_name) {
-               ACCOUNT_ERROR("__service_iter_func: pkg name NULL \n");
-               return TRUE;
-       }
-       GList **pkg_list = (GList **)data;
-       char *pkgname = NULL;
-       pkgname = strdup(pkg_name);
-       *pkg_list = g_list_append(*pkg_list, pkgname);
-       return TRUE;
-}
-
-ACCOUNT_API int account_query_service_list_by_capability(service_list_cb callback,
-                                                                       const char* capability_type,
-                                                                       void *user_data)
-{
-       int ret = SERVICE_ERROR_NONE;
-       GList *pkg_list = NULL;
-       service_h service = NULL;
-       GList *iter = NULL;
-       char *list_item = NULL;
-       char *capability_filter = NULL;
-       bool supported = false;
-       char *icon_path = NULL;
-       bool multiple = false;
-       int error_code = ACCOUNT_ERROR_NONE;
-
-       ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CAPABILITY TYPE IS NULL"));
-       ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("CALL BACK IS NULL"));
-
-       ACCOUNT_VERBOSE("account_query_service_list_by_capability START \n");
-       ret = service_create(&service);
-       if (ret != SERVICE_ERROR_NONE) {
-               ACCOUNT_ERROR("Owner Check : service_create fail ret=%d\n", ret);
-               return ret;
-       } else {
-               ACCOUNT_VERBOSE("service_list_by: service_create SUCCESS!!!!!! ret=%d\n", ret);
-       }
-       ret = service_set_operation(service, ACCOUNT_OPERATION_SIGNIN);
-       if (ret != SERVICE_ERROR_NONE) {
-               ACCOUNT_ERROR("service_list_by : service_set_operation fail ret=%d\n", ret);
-               service_destroy(service);
-               return ret;
-       } else {
-               ACCOUNT_VERBOSE("service_list_by : service_set_operation SUCCESS!!!!!! ret=%d\n",
-                                                       ret);
-       }
-       ret = service_foreach_app_matched(service, __service_iter_func, &pkg_list);
-       if (ret != SERVICE_ERROR_NONE) {
-               ACCOUNT_ERROR("service_list_by : service_foreach_app_matched fail ret=%d\n",
-                                                       ret);
-               service_destroy(service);
-               return ret;
-       } else {
-               ACCOUNT_VERBOSE("service_list_by : service_foreach_app_matched SUCCESS!!!!!! ret=%d\n",
-                                                       ret);
-       }
-
-       ret = service_destroy(service);
-       if (ret != SERVICE_ERROR_NONE) {
-               ACCOUNT_ERROR("service_list_by : service_destroy fail ret=%d\n", ret);
-               for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
-                       list_item = (char *)iter->data;
-                       g_free(list_item);
-               }
-               g_list_free(pkg_list);
-               return ret;
-       } else {
-               ACCOUNT_VERBOSE("service_list_by : service_destroy SUCCESS!!!!!! ret=%d\n", ret);
-       }
-
-       capability_filter = strdup(capability_type);
-
-       for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
-               list_item = (char *)iter->data;
-               error_code = account_get_application_capability_support(list_item,
-                                                                                                               capability_filter,
-                                                                                                               &supported);
-
-               if ((error_code != ACCOUNT_ERROR_NONE)
-                       && (error_code != ACCOUNT_ERROR_XML_FILE_NOT_FOUND)) {
-                       ACCOUNT_ERROR("service_list_by : account_get_application_capability_support fail error_code=%d\n", error_code);
-                       for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
-                               list_item = (char *)iter->data;
-                               g_free(list_item);
-                       }
-                       g_list_free(pkg_list);
-                       _ACCOUNT_FREE(capability_filter);
-                       return error_code;
-               }
-
-               if (supported) {
-                       error_code = account_get_application_icon_path(list_item, &icon_path);
-                       if (error_code != ACCOUNT_ERROR_NONE) {
-                               ACCOUNT_ERROR("service_list_by : account_get_application_capability_support fail error_code=%d\n", error_code);
-                               for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
-                                       list_item = (char *)iter->data;
-                                       g_free(list_item);
-                               }
-                               g_list_free(pkg_list);
-                               _ACCOUNT_FREE(capability_filter);
-                               return error_code;
-                       }
-                       error_code = account_get_application_multiple_account_support(list_item, &multiple);
-                       if (error_code != ACCOUNT_ERROR_NONE) {
-                               ACCOUNT_ERROR("service_list_by : account_get_application_capability_support fail error_code=%d\n", error_code);
-                               for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
-                                       list_item = (char *)iter->data;
-                                       g_free(list_item);
-                               }
-                               g_list_free(pkg_list);
-                               _ACCOUNT_FREE(capability_filter);
-                               return error_code;
-                       }
-                       callback(list_item, icon_path, multiple, user_data);
-               }
-       }
-       /* free list */
-       for (iter = pkg_list; iter != NULL; iter = g_list_next(iter)) {
-               list_item = (char *)iter->data;
-               g_free(list_item);
-       }
-       g_list_free(pkg_list);
-       _ACCOUNT_FREE(capability_filter);
-       return ACCOUNT_ERROR_NONE;
-}
diff --git a/src/account-xml-verify.c b/src/account-xml-verify.c
deleted file mode 100755 (executable)
index e3c2cf6..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *  account
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Sungchan Kim <sungchan81.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <account-types.h>
-#include <account.h>
-
-static char *_account_list_get_capablity_string_value(char *key)
-{
-       if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_CONTACT, key))
-               return "Contact";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR, key))
-               return "Calendar";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_PHOTO, key))
-               return "Photo";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_VIDEO, key))
-               return "Video";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_EMAIL, key))
-               return "Email";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_POST, key))
-               return "Post";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_VOIP, key))
-               return "VOIP";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_SAMSUNG_APPS, key))
-               return "Samsung Apps";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MOBILE_TRACKER, key))
-               return "Mobile Tracker";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_TASK, key))
-               return "Task";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_S_NOTE, key))
-               return "S note";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_GALLERY, key))
-               return "Gallery";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MUSIC, key))
-               return "Music";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MEMO, key))
-               return "Memo";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE, key))
-               return "Message";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_CHAT, key))
-               return "Chat";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_BOOKMARK, key))
-               return "Bookmark";
-       else if (!strcmp(ACCOUNT_SUPPORTS_CAPABILITY_TIZEN_EMAIL, key))
-               return "Tizen Email";
-       else
-               return "::ERROR::Unkown:Recheck String !!!!";
-}
-
-void parseCap (xmlDocPtr doc, xmlNodePtr cur)
-{
-       xmlChar *key;
-       cur = cur->xmlChildrenNode;
-       printf("\n List of supported Capabilities is :\n");
-       while (cur != NULL) {
-               if ((!xmlStrcmp(cur->name, (const xmlChar *)"capability"))) {
-                       key = xmlNodeGetContent(cur);
-                       printf("\n :: %s :: \n", _account_list_get_capablity_string_value((char *)key));
-                       xmlFree(key);
-               }
-               cur = cur->next;
-       }
-       return;
-}
-
-static void parseDoc(char *docname)
-{
-       xmlDocPtr doc = NULL;
-       xmlNodePtr cur = NULL;
-       xmlChar *attr = NULL;
-       xmlChar *icon_path = NULL;
-
-       doc = xmlParseFile(docname);
-
-       if (doc == NULL ) {
-               fprintf(stderr,"::ERROR::Document not parsed successfully. \n");
-               return;
-       }
-
-       cur = xmlDocGetRootElement(doc);
-
-       if (cur == NULL) {
-               fprintf(stderr,"::ERROR::empty document.\n");
-               xmlFreeDoc(doc);
-               return;
-       }
-
-       if (xmlStrcmp(cur->name, (const xmlChar *) "account")) {
-               fprintf(stderr,"::ERROR::document of the wrong type, root node != account.");
-               xmlFreeDoc(doc);
-               return;
-       }
-       attr = xmlGetProp(cur, (const xmlChar *)"multiple");
-
-       if (attr == NULL)
-               printf("\n multiple attribute not set, by default it will be taken as false.\n");
-       else if (!strcmp("false", (char *)attr))
-               printf("\n :: multiple = %s  ::\n",attr);
-       else if (!strcmp("true", (char *)attr))
-               printf("\n :: multiple = %s  :: \n",attr);
-       else
-               fprintf(stderr,"::ERROR:: Only multiple can be set as false or true. \n");
-
-       icon_path = xmlGetProp(cur, (const xmlChar *)"icon_path");
-
-       if (icon_path == NULL)
-               printf("\n icon path is NULL.\n");
-       else
-               printf("\n :: icon path = %s  ::\n",icon_path);
-
-
-       parseCap(doc, cur);
-       xmlFreeDoc(doc);
-       return;
-}
-
-int main(int argc, char **argv)
-{
-       char *docname = NULL;
-
-       if (argc <= 1) {
-               printf("Usage: %s xml_file_path\n", argv[0]);
-               return(0);
-       }
-       printf("\n #############################################################################\n");
-       docname = argv[1];
-       parseDoc (docname);
-       printf("\n #############################################################################\n");
-       return (1);
-}
index 731c197..4a143a1 100755 (executable)
@@ -30,7 +30,6 @@
 #include <assert.h>
 #include <account-private.h>
 #include <vconf.h>
-#include <app.h>
 
 #include <pkgmgr-info.h>
 #include <aul.h>
@@ -3601,7 +3600,26 @@ CATCH:
        return error_code;
 }
 
-ACCOUNT_API int account_delete_from_db_by_package_name(char *package_name)
+static bool _account_delete_from_db_by_package_name_cb(account_h account, void *user_data)
+{
+       GSList  **account_id_list = (GSList**)user_data;
+       int     account_id = 0;
+       char    id_buf[10] ={0,};
+       char*   tmp_ptr = NULL;
+
+       account_get_account_id(account, &account_id);
+       ACCOUNT_SNPRINTF(id_buf, sizeof(id_buf), "%d", account_id);
+
+       tmp_ptr = strdup(id_buf);
+
+       ACCOUNT_SLOGD("id = %s", id_buf);
+
+       *account_id_list = g_slist_append(*account_id_list, tmp_ptr);
+
+       return TRUE;
+}
+
+ACCOUNT_API int account_delete_from_db_by_package_name(const char *package_name)
 {
        int                     error_code = ACCOUNT_ERROR_NONE;
        account_stmt    hstmt = NULL;
@@ -3610,10 +3628,13 @@ ACCOUNT_API int account_delete_from_db_by_package_name(char *package_name)
        int                     ret_transaction = 0;
        bool                    is_success = FALSE;
        int                     binding_count = 1;
+       GSList                  *account_id_list = NULL;
 
        ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("package_name is null!"));
        ACCOUNT_RETURN_VAL((g_hAccountDB != NULL), {}, ACCOUNT_ERROR_DB_NOT_OPENED, ("The database isn't connected."));
 
+       account_query_account_by_package_name(_account_delete_from_db_by_package_name_cb, package_name, (void*)&account_id_list);
+
        /* transaction control required*/
        ret_transaction = _account_begin_transaction();
 
@@ -3691,9 +3712,17 @@ CATCH:
                ACCOUNT_ERROR("account_svc_delete:_account_svc_end_transaction fail %d, is_success=%d\n", ret_transaction, is_success);
        } else {
                if (is_success == true) {
+                       GSList* iter;
+                       for (iter = account_id_list; iter != NULL; iter = g_slist_next(iter)) {
+                               char* p_tmpid = NULL;
+                               p_tmpid = (char*)iter->data;
                        char buf[64]={0,};
-                       ACCOUNT_SNPRINTF(buf, sizeof(buf), "%s:%d", ACCOUNT_NOTI_NAME_DELETE, -1);
+                               ACCOUNT_SNPRINTF(buf, sizeof(buf), "%s:%s", ACCOUNT_NOTI_NAME_DELETE, p_tmpid);
+                               ACCOUNT_VERBOSE("%s", buf);
                        _account_insert_delete_update_notification_send(buf);
+                               _ACCOUNT_FREE(p_tmpid);
+                       }
+                       g_slist_free(account_id_list);
                }
        }