set the monitor default policy to 0 36/79836/1 accepted/tizen/common/20160713.144946 accepted/tizen/mobile/20160713.094400 submit/tizen/20160713.071839
authorKyoungyong Lee <bluevox@naver.com>
Wed, 13 Jul 2016 07:13:09 +0000 (16:13 +0900)
committerKyoungyong Lee <bluevox@naver.com>
Wed, 13 Jul 2016 07:13:15 +0000 (16:13 +0900)
Change-Id: Ia7f190bfaf43000642997c616d8f41669b0f7361

pkgmgr_plugin/privileges.cpp
server/src/CynaraService.cpp
server/src/PrivacyGuardDb.cpp

index d2e5315..4609698 100755 (executable)
@@ -25,7 +25,7 @@
 #include "privacy_guard_client_internal.h"
 #include "PrivacyGuardClient.h"
 
-#define DEFAULT_MONITOR_POLICY 1
+#define DEFAULT_MONITOR_POLICY 0
 
 static const xmlChar _NODE_PRIVILEGES[]                = "privileges";
 static const xmlChar _NODE_PRIVILEGE[]         = "privilege";
index 5255a97..f649180 100755 (executable)
@@ -213,7 +213,7 @@ CynaraService::updateDb(cynara_monitor_entry **monitor_entries)
 
                        // check app ID
                        std::string tempAppId = client;
-                       PG_LOGD("App ID from cynara: [%s]", client);
+                       //PG_LOGD("App ID from cynara: [%s]", client);
                        if (tempAppId.substr(0, USER_APP_PREFIX_LEN).compare(USER_APP_PREFIX) == 0) {
                                appId = tempAppId.substr(USER_APP_PREFIX_LEN, tempAppId.length() - USER_APP_PREFIX_LEN);
                                PG_LOGD("App ID: [%s]", appId.c_str());
@@ -224,7 +224,6 @@ CynaraService::updateDb(cynara_monitor_entry **monitor_entries)
 
                        // get package ID from app ID                   
                        pkgmgrinfo_appinfo_h pkgmgrinfo_appinfo;
-                       PG_LOGD("User ID: [%d], Global User ID: [%d]", userId, GLOBAL_USER);
                        if (userId == GLOBAL_USER) {
                                res = pkgmgrinfo_appinfo_get_appinfo(appId.c_str(), &pkgmgrinfo_appinfo);
                        } else {
@@ -239,7 +238,7 @@ CynaraService::updateDb(cynara_monitor_entry **monitor_entries)
                                        PG_LOGE("Failed to do pkgmgrinfo_appinfo_get_pkgname [%d] for the app [%s]. So set the package ID to app ID.", res, appId.c_str());
                                        packageId = appId;
                                }
-                               PG_LOGD("Package ID of [%s] is [%s]", appId.c_str(), package_id);
+                               //PG_LOGD("Package ID of [%s] is [%s]", appId.c_str(), package_id);
                                package_id_dup = strdup(package_id);
                                packageId = package_id_dup;
                                pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo);
@@ -259,7 +258,6 @@ CynaraService::updateDb(cynara_monitor_entry **monitor_entries)
                                        PG_LOGE("Failed to do pkgmgrinfo_pkginfo_is_global [%d]", res);
                                } else {
                                        if (is_global == true) {
-                                               PG_LOGD("[%s] is a global app. So set the user_id to 0.", packageId.c_str());
                                                userId = GLOBAL_APP_USER_ID;
                                        }
                                }
@@ -271,10 +269,7 @@ CynaraService::updateDb(cynara_monitor_entry **monitor_entries)
 
                        // add access log
                        int ret = PrivacyGuardDb::getInstance()->PgAddPrivacyAccessLogForCynara(userId, packageId, privacyId, date);
-                       if(ret == PRIV_GUARD_ERROR_SUCCESS){
-                               PG_LOGD("Succeeded to add access log to DB. UserID:[%d], PackageID:[%s], Privacy:[%s]", userId, packageId.c_str(), privacyId.c_str());
-                       }
-                       else{
+                       if(ret != PRIV_GUARD_ERROR_SUCCESS){
                                PG_LOGE("Failed to add access log to DB. UserID:[%d], PackageID:[%s], Privacy:[%s]", userId, packageId.c_str(), privacyId.c_str());                             
                        }
                }
index dd60f8b..af86fb0 100755 (executable)
@@ -96,7 +96,7 @@ PrivacyGuardDb::PgAddPrivacyAccessLogForCynara(const int userId, const std::stri
        res = PgGetMonitorPolicy(userId, packageId, privacyId, monitorPolicy);
        TryReturn(res == PRIV_GUARD_ERROR_SUCCESS, res, , "PgGetMonitorPolicy is failed: [%d]", res);
        if (monitorPolicy == 0) {
-               PG_LOGD("Monitor Policy is 0. So skip it. UserId:[%d], PrivacyId:[%s], PackageId:[%s], Policy:[%d]", userId, privacyId.c_str(), packageId.c_str(), monitorPolicy);
+               //PG_LOGD("Monitor Policy is 0. So skip it. UserId:[%d], PrivacyId:[%s], PackageId:[%s], Policy:[%d]", userId, privacyId.c_str(), packageId.c_str(), monitorPolicy);
                return PRIV_GUARD_ERROR_SUCCESS;
        }