fix code for coding convention 31/101631/2 accepted/tizen/common/20161202.233338 accepted/tizen/ivi/20161205.000420 accepted/tizen/ivi/20161205.232540 accepted/tizen/mobile/20161205.000333 accepted/tizen/mobile/20161205.232505 accepted/tizen/unified/20170309.031545 accepted/tizen/wearable/20161205.000400 accepted/tizen/wearable/20161205.232527 submit/tizen/20161202.063824 submit/tizen/20161205.012736 submit/tizen_unified/20170308.100404
authorIckhee Woo <ickhee.woo@samsung.com>
Thu, 1 Dec 2016 22:38:59 +0000 (07:38 +0900)
committerIckhee Woo <ickhee.woo@samsung.com>
Thu, 1 Dec 2016 23:50:15 +0000 (08:50 +0900)
Change-Id: Ifcf7830008c30517c53d863079499aec26880910
Signed-off-by: Ickhee Woo <ickhee.woo@samsung.com>
packaging/account-parser.spec
src/account-dlog.h
src/account.c

index 1efe360..4cc100e 100644 (file)
@@ -1,6 +1,6 @@
 Name:          account-parser
 Summary:       Account Parser Library
-Version:       0.1.2
+Version:       0.1.3
 Release:       0
 Group:         Social & Content/Other
 License:       Apache-2.0
index b7a6f80..46d0171 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <dlog.h>
 
-#define COLOR_GREEN    "\033[0;32m"
+#define COLOR_GREEN            "\033[0;32m"
 #define COLOR_END              "\033[0;m"
 
 #ifdef LOG_TAG
 
 #define LOG_TAG "ACCOUNT_PARSER"
 
-#define _E(fmt, arg...) LOGE("[%s:%d] "fmt,__FUNCTION__,__LINE__,##arg)
-#define _D(fmt, arg...) LOGD("[%s:%d] "fmt,__FUNCTION__,__LINE__,##arg)
-#define _SECURE_E(fmt, arg...) SECURE_LOGE("[%s:%d] "fmt,__FUNCTION__,__LINE__,##arg)
-#define _SECURE_D(fmt, arg...) SECURE_LOGD("[%s:%d] "fmt,__FUNCTION__,__LINE__,##arg)
+#define _E(fmt, arg...) LOGE("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg)
+#define _D(fmt, arg...) LOGD("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg)
+#define _SECURE_E(fmt, arg...) SECURE_LOGE("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg)
+#define _SECURE_D(fmt, arg...) SECURE_LOGD("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg)
 #define ENTER() LOGD(COLOR_GREEN"BEGIN >>>"COLOR_END);
 
 #define retvm_if(expr, val, fmt, arg...) do { \
-       if(expr) { \
+       if (expr) { \
                _E(fmt, ##arg); \
                _E("(%s) -> %s() return", #expr, __FUNCTION__); \
                return (val); \
 } while (0)
 
 #define retv_if(expr, val) do { \
-       if(expr) { \
+       if (expr) { \
                _E("(%s) -> %s() return", #expr, __FUNCTION__); \
                return (val); \
        } \
 } while (0)
 
 #define retm_if(expr, fmt, arg...) do { \
-       if(expr) { \
+       if (expr) { \
                _E(fmt, ##arg); \
                _E("(%s) -> %s() return", #expr, __FUNCTION__); \
                return; \
@@ -58,7 +58,7 @@
 } while (0)
 
 #define ret_if(expr) do { \
-       if(expr) { \
+       if (expr) { \
                _E("(%s) -> %s() return", #expr, __FUNCTION__); \
                return; \
        } \
index 9f44017..1739447 100644 (file)
@@ -91,19 +91,18 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
        _D("Registering the Account Provider.");
 
        int ret = ACCOUNT_ERROR_NONE;
-
        int ret2 = ACCOUNT_ERROR_NONE;
 
        account_type_h account_type_handle = NULL;
        ret = account_type_create(&account_type_handle);
-       if(ret != ACCOUNT_ERROR_NONE || account_type_handle == NULL) {
+       if (ret != ACCOUNT_ERROR_NONE || account_type_handle == NULL) {
                _E("[%d]Memory allocation failed.", ret);
                return ret;
        }
 
        // Node: <account>
        xmlNodePtr cur_ptr = xmlFirstElementChild(xmlDocGetRootElement(docPtr));
-       if(cur_ptr == NULL) {
+       if (cur_ptr == NULL) {
                ret = -1;
                _E("Failed to get the element.");
                goto CATCH;
@@ -113,20 +112,20 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
        // Get the children nodes
        cur_ptr = cur_ptr->xmlChildrenNode;
-       if(cur_ptr == NULL) {
+       if (cur_ptr == NULL) {
                ret = -1;
                _E("Failed to get the child element.");
                goto CATCH;
        }
 
-       while(cur_ptr != NULL) {
+       while (cur_ptr != NULL) {
                _SECURE_D("Node: %s", cur_ptr->name);
 
                // Node: <account-provider>
-               if((!xmlStrcmp(cur_ptr->name, _NODE_ACCOUNT_PROVIDER))) {
+               if ((!xmlStrcmp(cur_ptr->name, _NODE_ACCOUNT_PROVIDER))) {
                        // Attribute: appid
                        xmlChar* attribute_app_id = xmlGetProp(cur_ptr, _ATTRIBUTE_APP_ID);
-                       if(attribute_app_id == NULL) {
+                       if (attribute_app_id == NULL) {
                                ret = -1;
                                _E("Failed to get the attribute.");
                                goto CATCH;
@@ -135,28 +134,27 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                        _SECURE_D("Attribute: appid - %s", attribute_app_id);
 
                        ret = account_type_set_app_id(account_type_handle, (char*)attribute_app_id);
-                       if(ret != ACCOUNT_ERROR_NONE) {
+                       if (ret != ACCOUNT_ERROR_NONE) {
                                _E("Failed to set the app ID.");
                                goto CATCH;
                        }
 
                        // Attribute: providerid
                        xmlChar* attribute_provider_id = xmlGetProp(cur_ptr, _ATTRIBUTE_SERVICE_PROVIDER_ID);
-                       if(attribute_provider_id != NULL) {
+                       if (attribute_provider_id != NULL) {
                                ret = -1;
                                _E("Failed to get the attribute(providerid).");
 
                                _SECURE_D("Attribute: appid - %s", attribute_provider_id);
 
                                ret = account_type_set_service_provider_id(account_type_handle, (char*)attribute_provider_id);
-                               if(ret != ACCOUNT_ERROR_NONE) {
+                               if (ret != ACCOUNT_ERROR_NONE)
                                        _E("Failed to set the service provider id.");
-                               }
                        }
 
                        // Attribute: multiple-accounts-support
                        xmlChar* multiple_accounts_support = xmlGetProp(cur_ptr, _ATTRIBUTE_MULTIPLE_ACCOUNTS_SUPPORT);
-                       if(multiple_accounts_support == NULL) {
+                       if (multiple_accounts_support == NULL) {
                                ret = -1;
                                _E("Failed to get the attribute.");
                                goto CATCH;
@@ -164,16 +162,15 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                        _SECURE_D("Attribute: multiple-accounts-support - %s", multiple_accounts_support);
 
-                       if((!xmlStrcmp(multiple_accounts_support, _VALUE_TRUE))) {
+                       if ((!xmlStrcmp(multiple_accounts_support, _VALUE_TRUE))) {
                                ret = account_type_set_multiple_account_support(account_type_handle, true);
-                               if(ret != ACCOUNT_ERROR_NONE) {
+                               if (ret != ACCOUNT_ERROR_NONE) {
                                        _E("Failed to set the multiple accounts support.");
                                        goto CATCH;
                                }
                        } else {
                                ret = account_type_set_multiple_account_support(account_type_handle, false);
-                               if (ret != ACCOUNT_ERROR_NONE)
-                               {
+                               if (ret != ACCOUNT_ERROR_NONE) {
                                        _E("Failed to set the multiple accounts support.");
                                        goto CATCH;
                                }
@@ -181,20 +178,20 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                        // Get the children nodes
                        cur_ptr = cur_ptr->xmlChildrenNode;
-                       if(cur_ptr == NULL) {
+                       if (cur_ptr == NULL) {
                                ret = -1;
                                _E("Failed to get the child element.");
                                goto CATCH;
                        }
 
-                       while(cur_ptr != NULL) {
+                       while (cur_ptr != NULL) {
                                _SECURE_D("Node: %s", cur_ptr->name);
 
                                // Node: <icon>
-                               if((!xmlStrcmp(cur_ptr->name, _NODE_ICON))) {
+                               if ((!xmlStrcmp(cur_ptr->name, _NODE_ICON))) {
                                        // Attribute: section
                                        xmlChar* section = xmlGetProp(cur_ptr, _ATTRIBUTE_SECTION);
-                                       if(section == NULL) {
+                                       if (section == NULL) {
                                                ret = -1;
                                                _E("Failed to get the attribute.");
                                                goto CATCH;
@@ -203,9 +200,9 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                        _SECURE_D("Attribute: section - %s", section);
 
                                        char *resource_path = NULL;
-                                       if((!xmlStrcmp(section, _VALUE_ACCOUNT))) {
+                                       if ((!xmlStrcmp(section, _VALUE_ACCOUNT))) {
                                                xmlChar* account_icon = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
-                                               if(account_icon == NULL) {
+                                               if (account_icon == NULL) {
                                                        ret = -1;
                                                        _E("Failed to get the value.");
                                                        goto CATCH;
@@ -215,14 +212,14 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                                                if (!strncmp((const char*)account_icon, "/usr/share/icons", 16)) {
                                                        ret = account_type_set_icon_path(account_type_handle, (char*)account_icon);
-                                                       if(ret != ACCOUNT_ERROR_NONE) {
+                                                       if (ret != ACCOUNT_ERROR_NONE) {
                                                                _E("Failed to set the icon path.");
                                                                goto CATCH;
                                                        }
                                                } else {
                                                        if (!strcmp((const char*)attribute_app_id, "com.samsung.samsungaccount")) {
                                                                char *icon_path = g_strdup_printf("%s%s", "/usr/apps/com.samsung.samsungaccount/shared/res/", (const char*)account_icon);
-                                                               if(icon_path == NULL) {
+                                                               if (icon_path == NULL) {
                                                                        _E("icon_path is NULL.");
                                                                        free(resource_path);
                                                                        goto CATCH;
@@ -230,7 +227,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                                                                _D("icon_path[%s]", icon_path);
                                                                ret = account_type_set_icon_path(account_type_handle, icon_path);
-                                                               if(ret != ACCOUNT_ERROR_NONE) {
+                                                               if (ret != ACCOUNT_ERROR_NONE) {
                                                                        _E("Failed to set the icon path.");
                                                                        g_free(icon_path);
                                                                        goto CATCH;
@@ -238,7 +235,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                                g_free(icon_path);
                                                        } else if (!strcmp((const char*)attribute_app_id, "com.samsung.tizenaccount")) {
                                                                char *icon_path = g_strdup_printf("%s%s", "/usr/apps/com.samsung.tizenaccount/shared/res/", (char*)account_icon);
-                                                               if(icon_path == NULL) {
+                                                               if (icon_path == NULL) {
                                                                        _E("icon_path is NULL.");
                                                                        free(resource_path);
                                                                        goto CATCH;
@@ -246,7 +243,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                                                                _D("icon_path[%s]", icon_path);
                                                                ret = account_type_set_icon_path(account_type_handle, icon_path);
-                                                               if(ret != ACCOUNT_ERROR_NONE) {
+                                                               if (ret != ACCOUNT_ERROR_NONE) {
                                                                        _E("Failed to set the icon path.");
                                                                        g_free(icon_path);
                                                                        goto CATCH;
@@ -260,13 +257,13 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                                }
 
                                                                ret = aul_get_usr_app_shared_resource_path_by_appid((char*)attribute_app_id, &resource_path, uid);
-                                                               if(ret != APP_MANAGER_ERROR_NONE) {
+                                                               if (ret != APP_MANAGER_ERROR_NONE) {
                                                                        _E("Failed to get the shared resource path. app_manager ret=[%d]", ret);
                                                                        goto CATCH;
                                                                }
 
                                                                char *icon_path = g_strdup_printf("%s%s", resource_path, (char*)account_icon);
-                                                               if(icon_path == NULL) {
+                                                               if (icon_path == NULL) {
                                                                        _E("icon_path is NULL.");
                                                                        free(resource_path);
                                                                        goto CATCH;
@@ -276,7 +273,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                                                                _D("icon_path[%s]", icon_path);
                                                                ret = account_type_set_icon_path(account_type_handle, icon_path);
-                                                               if(ret != ACCOUNT_ERROR_NONE) {
+                                                               if (ret != ACCOUNT_ERROR_NONE) {
                                                                        _E("Failed to set the icon path.");
                                                                        g_free(icon_path);
                                                                        goto CATCH;
@@ -284,9 +281,9 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                                g_free(icon_path);
                                                        }
                                                }
-                                       } else if((!xmlStrcmp(section, _VALUE_ACCOUNT_SMALL))) {
+                                       } else if ((!xmlStrcmp(section, _VALUE_ACCOUNT_SMALL))) {
                                                xmlChar* account_small_icon = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
-                                               if(account_small_icon == NULL) {
+                                               if (account_small_icon == NULL) {
                                                        ret = -1;
                                                        _E("Failed to get the value.");
                                                        goto CATCH;
@@ -296,14 +293,14 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                                                if (!strncmp((const char*)account_small_icon, "/usr/share/icons", 16) || !strcmp((const char*)account_small_icon, "/usr/apps/com.samsung.tizenaccount/shared/res/TizenAccount.png")) {
                                                        ret = account_type_set_small_icon_path(account_type_handle, (char*)account_small_icon);
-                                                       if(ret != ACCOUNT_ERROR_NONE) {
+                                                       if (ret != ACCOUNT_ERROR_NONE) {
                                                                _E("Failed to set the small icon path.");
                                                                goto CATCH;
                                                        }
                                                } else {
                                                        if (!strcmp((const char*)attribute_app_id, "com.samsung.samsungaccount")) {
                                                                char *small_icon_path = g_strdup_printf("%s%s", "/usr/apps/com.samsung.samsungaccount/shared/res/", (char*)account_small_icon);
-                                                               if(small_icon_path == NULL) {
+                                                               if (small_icon_path == NULL) {
                                                                        _E("small_icon_path is NULL.");
                                                                        free(resource_path);
                                                                        goto CATCH;
@@ -311,7 +308,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                                                                _D("small_icon_path[%s]", small_icon_path);
                                                                ret = account_type_set_small_icon_path(account_type_handle, (char*)small_icon_path);
-                                                               if(ret != ACCOUNT_ERROR_NONE) {
+                                                               if (ret != ACCOUNT_ERROR_NONE) {
                                                                        _E("Failed to set the small icon path.");
                                                                        g_free(small_icon_path);
                                                                        goto CATCH;
@@ -325,13 +322,13 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                                }
 
                                                                ret = aul_get_usr_app_shared_resource_path_by_appid((char*)attribute_app_id, &resource_path, uid);
-                                                               if(ret != APP_MANAGER_ERROR_NONE) {
+                                                               if (ret != APP_MANAGER_ERROR_NONE) {
                                                                        _E("Failed to get the shared resource path.");
                                                                        goto CATCH;
                                                                }
 
                                                                char *small_icon_path = g_strdup_printf("%s%s", resource_path, (char*)account_small_icon);
-                                                               if(small_icon_path == NULL) {
+                                                               if (small_icon_path == NULL) {
                                                                        _E("small_icon_path is NULL.");
                                                                        free(resource_path);
                                                                        goto CATCH;
@@ -341,7 +338,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
 
                                                                _D("small_icon_path[%s]", small_icon_path);
                                                                ret = account_type_set_small_icon_path(account_type_handle, (char*)small_icon_path);
-                                                               if(ret != ACCOUNT_ERROR_NONE) {
+                                                               if (ret != ACCOUNT_ERROR_NONE) {
                                                                        _E("Failed to set the small icon path.");
                                                                        g_free(small_icon_path);
                                                                        goto CATCH;
@@ -350,28 +347,28 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                        }
                                                }
                                        }
-                               } else if((!xmlStrcmp(cur_ptr->name, _NODE_LABEL))) {
+                               } else if ((!xmlStrcmp(cur_ptr->name, _NODE_LABEL))) {
                                        // Node: <label>
 
                                        _SECURE_D("Node: %s", cur_ptr->name);
 
                                        // Attribute: xml:lang
                                        xmlChar* xml_lang = xmlNodeGetLang(cur_ptr);
-                                       if(xml_lang != NULL) {
+                                       if (xml_lang != NULL) {
                                                _SECURE_D("Attribute: xml:lang - %s", xml_lang);
 
                                                char* lang = (char*)xml_lang;
                                                char* converted_lang = NULL;
 
                                                gchar** tokens = g_strsplit(lang, "-", 2);
-                                               if(tokens == NULL) {
+                                               if (tokens == NULL) {
                                                        ret = -1;
                                                        _E("Failed to get token.");
                                                        goto CATCH;
                                                }
 
                                                char* upper_token = g_ascii_strup(tokens[1], strlen(tokens[1]));
-                                               if(upper_token == NULL) {
+                                               if (upper_token == NULL) {
                                                        ret = -1;
                                                        g_strfreev(tokens);
                                                        _E("Failed to convert to upper case.");
@@ -381,7 +378,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                converted_lang = g_strdup_printf("%s_%s", tokens[0], upper_token);
                                                free(upper_token);
 
-                                               if(converted_lang == NULL) {
+                                               if (converted_lang == NULL) {
                                                        ret = -1;
                                                        g_strfreev(tokens);
                                                        _E("Failed to convert to upper case.");
@@ -393,7 +390,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                g_strfreev(tokens);
 
                                                xmlChar* xml_label = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
-                                               if(xml_label == NULL) {
+                                               if (xml_label == NULL) {
                                                        ret = -1;
                                                        g_free(converted_lang);
                                                        _E("Failed to get the value.");
@@ -403,7 +400,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                _SECURE_D("Node: label - %s", xml_label);
 
                                                ret = account_type_set_label(account_type_handle, (char*)xml_label, converted_lang);
-                                               if(ret != ACCOUNT_ERROR_NONE) {
+                                               if (ret != ACCOUNT_ERROR_NONE) {
                                                        g_free(converted_lang);
                                                        _E("[%d]Failed to set the display name.", ret);
                                                        goto CATCH;
@@ -412,7 +409,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                g_free(converted_lang);
                                        } else {
                                                xmlChar* xml_label = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
-                                               if(xml_label == NULL) {
+                                               if (xml_label == NULL) {
                                                        ret = -1;
                                                        _E("Failed to get the value.");
                                                        goto CATCH;
@@ -421,18 +418,18 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                                _SECURE_D("Node: label - %s",  xml_label);
 
                                                ret = account_type_set_label(account_type_handle, (char*)xml_label, _DEFAULT_LOCALE);
-                                               if(ret != ACCOUNT_ERROR_NONE) {
+                                               if (ret != ACCOUNT_ERROR_NONE) {
                                                        _E("[%d]Failed to set the display name.", ret);
                                                        goto CATCH;
                                                }
                                        }
-                               } else if((!xmlStrcmp(cur_ptr->name, _NODE_CAPABILITY))) {
+                               } else if ((!xmlStrcmp(cur_ptr->name, _NODE_CAPABILITY))) {
                                        // Node: <capability>
 
                                        _SECURE_D("Node: %s", cur_ptr->name);
 
                                        xmlChar* xml_capability = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
-                                       if(xml_capability == NULL) {
+                                       if (xml_capability == NULL) {
                                                ret = -1;
                                                _E("Failed to get the value.");
                                                goto CATCH;
@@ -441,7 +438,7 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                                        _SECURE_D("Node: capability - %s",  xml_capability);
 
                                        ret = account_type_set_provider_feature(account_type_handle, (char*)xml_capability);
-                                       if(ret != ACCOUNT_ERROR_NONE) {
+                                       if (ret != ACCOUNT_ERROR_NONE) {
                                                _E("[%d]Failed to set the capability.", ret);
                                                goto CATCH;
                                        }
@@ -465,20 +462,19 @@ int _register_account_provider(xmlDocPtr docPtr, char* account_provider_app_id)
                        goto CATCH;
                }
 
-               if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
+               if (uid == OWNER_ROOT || uid == GLOBAL_USER)
                        ret = account_type_insert_to_db_offline(account_type_handle, &account_type_db_id);
-               } else {
+               else
                        ret = account_type_insert_to_db(account_type_handle, &account_type_db_id);
-               }
 
-               if(ret != ACCOUNT_ERROR_NONE) {
+               if (ret != ACCOUNT_ERROR_NONE) {
                        _E("[%d]Failed to perform account_type_insert_to_db().", ret);
                        goto CATCH;
                }
        }
 
        ret = account_type_destroy(account_type_handle);
-       if(ret != ACCOUNT_ERROR_NONE) {
+       if (ret != ACCOUNT_ERROR_NONE) {
                _E("[%d]Failed to perform account_type_destroy().", ret);
                goto CATCH;
        }
@@ -509,23 +505,22 @@ int _unregister_account_provider(pkgmgrinfo_appinfo_h package_info_handle, void*
        }
 
        //To Do : delete accounts of this app from all user db.
-       if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
+       if (uid == OWNER_ROOT || uid == GLOBAL_USER)
                ret = account_delete_from_db_by_package_name_offline((char*)app_id);
-       }else {
+       else
                ret = account_delete_from_db_by_package_name((char*)app_id);
-       }
-       if((ret != ACCOUNT_ERROR_NONE) && (ret !=  ACCOUNT_ERROR_RECORD_NOT_FOUND)) {
+
+       if ((ret != ACCOUNT_ERROR_NONE) && (ret !=  ACCOUNT_ERROR_RECORD_NOT_FOUND)) {
                _E("Failed to perform account_delete_from_db_by_package_name_offline().");
                goto CATCH;
        }
 
-       if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
+       if (uid == OWNER_ROOT || uid == GLOBAL_USER)
                ret = account_type_delete_by_app_id_offline((char*)app_id);
-       } else {
+       else
                ret = account_type_delete_by_app_id((char*)app_id);
-       }
 
-       if(ret != ACCOUNT_ERROR_NONE) {
+       if (ret != ACCOUNT_ERROR_NONE) {
                _E("Failed to perform account_type_delete_by_app_id().");
                goto CATCH;
        }
@@ -552,13 +547,12 @@ int _on_package_app_list_received_cb(pkgmgrinfo_appinfo_h handle, void *user_dat
                return -1;
        }
 
-       if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
+       if (uid == OWNER_ROOT || uid == GLOBAL_USER)
                ret = account_type_delete_by_app_id_offline((char*)app_id);
-       } else {
+       else
                ret = account_type_delete_by_app_id((char*)app_id);
-       }
 
-       if(ret == ACCOUNT_ERROR_NONE) {
+       if (ret == ACCOUNT_ERROR_NONE) {
                _D("PKGMGR_PARSER_PLUGIN_PRE_UPGRADE: app ID - %s", app_id);
                strncpy(__old_account_provider_app_id, app_id, 128);
 
@@ -596,20 +590,18 @@ int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char* packageId)
                return -1;
        }
 
-       if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
+       if (uid == OWNER_ROOT || uid == GLOBAL_USER)
                ret = pkgmgrinfo_pkginfo_get_pkginfo(packageId, &package_info_handle);
-       } else {
+       else
                ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(packageId, uid, &package_info_handle);
-       }
        retvm_if(ret != PMINFO_R_OK, ret, "[%d]Failed to pkgmgrinfo_pkginfo_get_pkginfo().", ret);
 
-       if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
-        ret = pkgmgrinfo_appinfo_get_list(package_info_handle, PMINFO_ALL_APP, _unregister_account_provider, NULL);
-       } else {
+       if (uid == OWNER_ROOT || uid == GLOBAL_USER)
+               ret = pkgmgrinfo_appinfo_get_list(package_info_handle, PMINFO_ALL_APP, _unregister_account_provider, NULL);
+       else
                ret = pkgmgrinfo_appinfo_get_usr_list(package_info_handle, PMINFO_ALL_APP, _unregister_account_provider, NULL, uid);
-       }
 
-       if(ret != PMINFO_R_OK) {
+       if (ret != PMINFO_R_OK) {
                _D("Failed to get the application information list.");
                pkgmgrinfo_pkginfo_destroy_pkginfo(package_info_handle);
 
@@ -637,20 +629,18 @@ int PKGMGR_PARSER_PLUGIN_PRE_UPGRADE(const char* packageId)
                return -1;
        }
 
-       if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
+       if (uid == OWNER_ROOT || uid == GLOBAL_USER)
                ret = pkgmgrinfo_pkginfo_get_pkginfo(packageId, &package_info_handle);
-       } else {
+       else
                ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(packageId, uid, &package_info_handle);
-       }
        retvm_if(ret != PMINFO_R_OK, ret, "[%d]Failed to pkgmgrinfo_pkginfo_get_pkginfo().", ret);
 
-       if (uid == OWNER_ROOT || uid == GLOBAL_USER) {
-        ret = pkgmgrinfo_appinfo_get_list(package_info_handle, PMINFO_ALL_APP, _on_package_app_list_received_cb, NULL);
-       } else {
+       if (uid == OWNER_ROOT || uid == GLOBAL_USER)
+               ret = pkgmgrinfo_appinfo_get_list(package_info_handle, PMINFO_ALL_APP, _on_package_app_list_received_cb, NULL);
+       else
                ret = pkgmgrinfo_appinfo_get_usr_list(package_info_handle, PMINFO_ALL_APP, _on_package_app_list_received_cb, NULL, uid);
-       }
 
-       if(ret != PMINFO_R_OK) {
+       if (ret != PMINFO_R_OK) {
                _D("Failed to get the application information list.");
                pkgmgrinfo_pkginfo_destroy_pkginfo(package_info_handle);
 
@@ -673,7 +663,7 @@ int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char* packageId)
        retvm_if(ret != 0, ret, "[%d]Failed to register the account provider.", ret);
 
        ret = account_query_account_by_package_name(_on_account_received_cb, __old_account_provider_app_id, (void*)account_provider_app_id);
-       if((ret != ACCOUNT_ERROR_NONE) && (ret != ACCOUNT_ERROR_RECORD_NOT_FOUND)) {
+       if ((ret != ACCOUNT_ERROR_NONE) && (ret != ACCOUNT_ERROR_RECORD_NOT_FOUND)) {
                _E("Failed to perform account_query_account_by_package_name().");
                goto CATCH;
        }