diff options
author | Hyunwoo Kim <hwlove.kim@samsung.com> | 2013-04-17 21:23:58 +0900 |
---|---|---|
committer | Hyunwoo Kim <hwlove.kim@samsung.com> | 2013-04-17 21:24:07 +0900 |
commit | 0706d833bbc2839692cce91fb72e674372b932de (patch) | |
tree | d22dacbc5dc7d8d6b998a3a86f586eb094107039 | |
parent | a18e48f79c6f54081a6430fe3613508ea49fc6c2 (diff) | |
download | privacy-manager-0706d833bbc2839692cce91fb72e674372b932de.tar.gz privacy-manager-0706d833bbc2839692cce91fb72e674372b932de.tar.bz2 privacy-manager-0706d833bbc2839692cce91fb72e674372b932de.zip |
Remove unnecessary logs
Change-Id: I2f4e22ade269cc425849ab87f95fcf73a9766ab9
Signed-off-by: Hyunwoo Kim <hwlove.kim@samsung.com>
-rw-r--r-- | client/src/PrivacyChecker.cpp | 20 | ||||
-rw-r--r-- | client/src/PrivacyManagerClient.cpp | 4 | ||||
-rw-r--r-- | client/src/SocketClient.cpp | 7 | ||||
-rw-r--r-- | client/src/privacy_manager_client.cpp | 9 | ||||
-rw-r--r-- | common/inc/SocketConnection.h | 1 | ||||
-rw-r--r-- | common/inc/Utils.h | 4 | ||||
-rw-r--r-- | common/src/PrivacyDb.cpp | 24 | ||||
-rw-r--r-- | common/src/PrivacyIdInfo.cpp | 3 | ||||
-rw-r--r-- | pkgmgr_plugin/privileges.cpp | 2 | ||||
-rw-r--r-- | server/src/NotificationServer.cpp | 6 | ||||
-rw-r--r-- | server/src/PrivacyManagerServer.cpp | 2 |
11 files changed, 28 insertions, 54 deletions
diff --git a/client/src/PrivacyChecker.cpp b/client/src/PrivacyChecker.cpp index 3c46c26..c90267b 100644 --- a/client/src/PrivacyChecker.cpp +++ b/client/src/PrivacyChecker.cpp @@ -204,16 +204,12 @@ PrivacyChecker::handleNotification(DBusConnection* connection, DBusMessage* mess int
PrivacyChecker::check(const std::string privacyId, std::map < std::string, bool >& privacyMap)
{
- LOGI("enter, %d", privacyMap.size());
+ LOGI("enter");
TryReturn(m_isInitialized, PRIV_MGR_ERROR_NOT_INITIALIZED, , "Not initialized");
std::map < std::string, bool >::iterator iter;
- for (iter = privacyMap.begin(); iter != privacyMap.end(); ++iter)
- {
- LOGD("data: %s, %d", iter->first.c_str(), iter->second);
- }
iter = privacyMap.find(privacyId);
if (iter == privacyMap.end() )
{
@@ -272,7 +268,7 @@ PrivacyChecker::check(const std::string pkgId, const std::string privacyId) if (iter->second.size() == 0)
{
- LOGD("NO PRIVACY contained");
+ LOGD("No privacy contained");
return PRIV_MGR_ERROR_USER_NOT_CONSENTED;
}
@@ -291,7 +287,7 @@ PrivacyChecker::checkWithPrivilege(const std::string pkgId, const std::string pr std::string privacyId;
int res = PrivacyIdInfo::getPrivacyIdFromPrivilege(privilege, privacyId);
if (res == PRIV_MGR_ERROR_NO_DATA) {
- LOGD("NOT privacy privilege");
+ LOGD("%s is not privacy privilege", privilege.c_str());
return PRIV_MGR_ERROR_SUCCESS;
}
@@ -309,8 +305,11 @@ PrivacyChecker::checkWithPrivilege(const std::string privilege) std::string privacyId;
int res = PrivacyIdInfo::getPrivacyIdFromPrivilege(privilege, privacyId);
- if (res == PRIV_MGR_ERROR_NO_DATA)
+ if (res == PRIV_MGR_ERROR_NO_DATA) {
+ LOGD("%s is not privacy privilege", privilege.c_str());
return PRIV_MGR_ERROR_SUCCESS;
+ }
+
TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "getPrivacyIdFromPrivilege : %d", res);
LOGI("leave");
@@ -327,6 +326,7 @@ PrivacyChecker::checkWithDeviceCap(const std::string pkgId, const std::string de int res = PrivacyIdInfo::getPrivacyIdFromDeviceCap(deviceCap, privacyId);
if (res == PRIV_MGR_ERROR_NO_DATA)
return PRIV_MGR_ERROR_SUCCESS;
+
TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "getPrivacyIdFromPrivilege : %d", res);
LOGI("leave");
@@ -343,6 +343,7 @@ PrivacyChecker::checkWithDeviceCap(const std::string deviceCap) int res = PrivacyIdInfo::getPrivacyIdFromDeviceCap(deviceCap, privacyId);
if (res == PRIV_MGR_ERROR_NO_DATA)
return PRIV_MGR_ERROR_SUCCESS;
+
TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "getPrivacyIdFromPrivilege : %d", res);
LOGI("leave");
@@ -369,7 +370,6 @@ PrivacyChecker::finalize(void) m_pHandlerGMainContext = NULL;
}
-
m_isInitialized = false;
return PRIV_MGR_ERROR_SUCCESS;
@@ -404,7 +404,7 @@ PrivacyChecker::updateCache(const std::string pkgId, std::string privacyId, std: {
bool privacyEnabled = sqlite3_column_int(pPrivacyStmt.get(), 0) > 0 ? true : false;
- LOGI("Set result : %s : %d", privacyId.c_str(), privacyEnabled );
+ LOGD("Set result : %s : %d", privacyId.c_str(), privacyEnabled );
pkgCacheMap.erase(privacyId);
pkgCacheMap.insert(std::map < std::string, bool >::value_type(privacyId, privacyEnabled));
}
diff --git a/client/src/PrivacyManagerClient.cpp b/client/src/PrivacyManagerClient.cpp index 7facd26..50d9bc6 100644 --- a/client/src/PrivacyManagerClient.cpp +++ b/client/src/PrivacyManagerClient.cpp @@ -145,10 +145,6 @@ PrivacyManagerClient::getAppPackagePrivacyInfo(const std::string pkgId, std::lis pSocketClient->disconnect();
TryReturn(res == PRIV_MGR_ERROR_SUCCESS, res, , "disconnect : %d", res);
- for (std::list < std::pair <std::string, bool > >::const_iterator iter = list.begin(); iter != list.end(); ++iter){
- LOGD(" %s : %d", iter->first.c_str(), iter->second);
- }
-
return result;
#endif
diff --git a/client/src/SocketClient.cpp b/client/src/SocketClient.cpp index 743d2d2..20ecb3d 100644 --- a/client/src/SocketClient.cpp +++ b/client/src/SocketClient.cpp @@ -25,13 +25,6 @@ #include "SocketClient.h"
#include <Utils.h>
-
-/*int
-SocketClient::throwWithErrnoMessage(const std::string& specificInfo){
- LOGE("%s : %s", specificInfo.c_str(), strerror(errno));
- return -1;
-}*/
-
#define throwWithErrnoMessage(specificInfo) do {\
LOGE("%s : %s", specificInfo, strerror(errno)); \
return -1; \
diff --git a/client/src/privacy_manager_client.cpp b/client/src/privacy_manager_client.cpp index 8f06890..920c12b 100644 --- a/client/src/privacy_manager_client.cpp +++ b/client/src/privacy_manager_client.cpp @@ -47,8 +47,6 @@ int create_privacy_info_client_s(const char* privacy_id, bool enabled, privacy_i int privacy_manager_client_install_privacy(const char *package_id, const char** privacy_list)
{
- LOGI("enter");
-
PrivacyManagerClient* pInst = PrivacyManagerClient::getInstance();
std::list < std::string > privacyList;
@@ -57,8 +55,6 @@ int privacy_manager_client_install_privacy(const char *package_id, const char** int retval = pInst->addAppPackagePrivacyInfo(std::string(package_id), privacyList, false);
- LOGI("leave");
-
return retval;
}
@@ -176,10 +172,7 @@ int privacy_manager_client_foreach_package_list_by_privacy(const char *privacy_i std::list < std::pair < std::string, bool > > packageList;
retval = pInst->getAppPackagesbyPrivacyId(std::string(privacy_id), packageList);
- for (std::list < std::pair < std::string, bool > >::iterator iter = packageList.begin(); iter != packageList.end(); ++iter)
- {
- LOGD("result : %s %d", iter->first.c_str(), iter->second);
- }
+
if (retval != PRIV_MGR_ERROR_SUCCESS)
return retval;
if (packageList.size() == 0)
diff --git a/common/inc/SocketConnection.h b/common/inc/SocketConnection.h index 3fa291d..14a50c2 100644 --- a/common/inc/SocketConnection.h +++ b/common/inc/SocketConnection.h @@ -254,7 +254,6 @@ public: int length = strlen(in);
int res = m_socketStream.writeStream(sizeof(length), &length);
TryReturn(res == PRIV_MGR_ERROR_SUCCESS, res, , "writeStream : %d", res);
- LOGD(" write char : %s %d", in, length);
res = m_socketStream.writeStream(length, in);
TryReturn(res == PRIV_MGR_ERROR_SUCCESS, res, , "writeStream : %d", res);
diff --git a/common/inc/Utils.h b/common/inc/Utils.h index 97bfad3..1e7c94e 100644 --- a/common/inc/Utils.h +++ b/common/inc/Utils.h @@ -46,8 +46,8 @@ return r; \ } else {;} -auto StmtDeleter = [&](sqlite3_stmt* pPtr) { /*LOGI("sqlite3_finalize");*/ sqlite3_reset (pPtr); sqlite3_finalize(pPtr); }; -auto DbDeleter = [&](sqlite3* pPtr) { /*LOGI("sqlite3_close");*/ /*sqlite3_close(pPtr);*/ db_util_close(pPtr); }; +auto StmtDeleter = [&](sqlite3_stmt* pPtr) { sqlite3_reset (pPtr); sqlite3_finalize(pPtr); }; +auto DbDeleter = [&](sqlite3* pPtr) { /*sqlite3_close(pPtr);*/ db_util_close(pPtr); }; #define setStmtToUniquePtr(x, y) std::unique_ptr < sqlite3_stmt, decltype(StmtDeleter) > x (y, StmtDeleter); #define setDbToUniquePtr(x, y) std::unique_ptr < sqlite3, decltype(DbDeleter) > x (y, DbDeleter); diff --git a/common/src/PrivacyDb.cpp b/common/src/PrivacyDb.cpp index 95a6b77..0d81d4c 100644 --- a/common/src/PrivacyDb.cpp +++ b/common/src/PrivacyDb.cpp @@ -117,8 +117,6 @@ PrivacyDb::getAppPackagePrivacyInfo(const std::string pkgId, std::list < std::pa int res = sqlite3_bind_text(pStmt.get(), 1, pkgId.c_str(), -1, SQLITE_TRANSIENT); TryReturn( res == SQLITE_OK, PRIV_MGR_ERROR_DB_ERROR, , "sqlite3_bind_int : %d", res); - LOGI("start"); - while ( (res= sqlite3_step(pStmt.get())) == SQLITE_ROW ) { const char* privacyId = reinterpret_cast < const char* > (sqlite3_column_text(pStmt.get(), 0)); @@ -218,12 +216,12 @@ PrivacyDb::isUserPrompted(const std::string pkgId, bool& isPrompted) const isPrompted = true; - if (isFilteredPackage(pkgId))
- {
- LOGD("%s is Filtered", pkgId.c_str());
- return 0;
- }
-
+ if (isFilteredPackage(pkgId)) + { + LOGD("%s is Filtered", pkgId.c_str()); + return 0; + } + openDb(PRIVACY_DB_PATH.c_str(), pDbHandler, SQLITE_OPEN_READONLY); prepareDb(pDbHandler, query.c_str(), pStmt); @@ -238,7 +236,7 @@ PrivacyDb::isUserPrompted(const std::string pkgId, bool& isPrompted) const } else { - LOGE("The package[%s] doesnt access privacy", pkgId.c_str()); + LOGE("The package[%s] can not access privacy", pkgId.c_str()); return PRIV_MGR_ERROR_SUCCESS; } @@ -248,7 +246,7 @@ PrivacyDb::isUserPrompted(const std::string pkgId, bool& isPrompted) const int PrivacyDb::setUserPrompted(const std::string pkgId, bool prompted) { - LOGI("enter :%s - %d", pkgId.c_str(), prompted); + LOGI("enter"); std::string query = std::string("UPDATE PackageInfo set IS_SET =? where PKG_ID=?"); @@ -266,6 +264,8 @@ PrivacyDb::setUserPrompted(const std::string pkgId, bool prompted) res = sqlite3_step(pStmt.get()); TryReturn( res == SQLITE_DONE, PRIV_MGR_ERROR_DB_ERROR, , "sqlite3_step : %d", res); + LOGI("leave"); + return 0; } @@ -288,11 +288,11 @@ PrivacyDb::getAppPackagesbyPrivacyId(std::string privacyId, std::list < std::pai const char* pPkgId = reinterpret_cast < const char* > (sqlite3_column_text(pStmt.get(), 0)); bool isEnabled = sqlite3_column_int(pStmt.get(), 1) > 0 ? true : false; - LOGD("result : %s %d", pPkgId, isEnabled); + LOGD("result : %s - %d", pPkgId, isEnabled); list.push_back( std::pair <std::string, bool >(std::string(pPkgId), isEnabled) ); } - LOGI("leave %d", res); + LOGI("leave"); return PRIV_MGR_ERROR_SUCCESS; } diff --git a/common/src/PrivacyIdInfo.cpp b/common/src/PrivacyIdInfo.cpp index 048f527..7b18e1a 100644 --- a/common/src/PrivacyIdInfo.cpp +++ b/common/src/PrivacyIdInfo.cpp @@ -122,7 +122,6 @@ PrivacyIdInfo::initialize(void) const char* privilegeId = reinterpret_cast < const char* > (sqlite3_column_text(pStmtPrivilege.get(), 0));
const char* privacyId = reinterpret_cast < const char* > (sqlite3_column_text(pStmtPrivilege.get(), 1));
m_privilegeToPrivacyMap.insert(std::map < std::string, std::string >::value_type(std::string(privilegeId), std::string(privacyId)));
- LOGD(" %s : %s", privilegeId, privacyId);
}
prepareDb(pDbHandler, sqlDeviceCap.c_str(), pStmtDeviceCap);
@@ -189,8 +188,6 @@ int PrivacyIdInfo::getAllPrivacyId(std::list < std::string >& privacyIdList)
{
static const std::string sql("SELECT PRIVACY_ID from PrivacyInfo");
-
- LOGI("enter");
openDb(PRIVACY_INFO_DB_PATH.c_str(), pDbHandler, SQLITE_OPEN_READONLY);
prepareDb(pDbHandler, sql.c_str(), pStmt);
diff --git a/pkgmgr_plugin/privileges.cpp b/pkgmgr_plugin/privileges.cpp index d5cdc8b..c0612e3 100644 --- a/pkgmgr_plugin/privileges.cpp +++ b/pkgmgr_plugin/privileges.cpp @@ -88,8 +88,6 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId) memcpy(ppPrivilegeList[i], iter->c_str(), strlen(iter->c_str()));
++iter;
}
- for (int i = 0; i < privilegeList.size(); ++i)
- LOGD(" values : %s", ppPrivilegeList[i]);
ppPrivilegeList[privilegeList.size()] = (char*)calloc (2, sizeof(char));
memcpy(ppPrivilegeList[privilegeList.size()], "\0", 1);
diff --git a/server/src/NotificationServer.cpp b/server/src/NotificationServer.cpp index ce8bd64..c9b5b6d 100644 --- a/server/src/NotificationServer.cpp +++ b/server/src/NotificationServer.cpp @@ -56,7 +56,7 @@ NotificationServer::initialize(void) std::unique_ptr < char[] > pRule(new char[MAX_LOCAL_BUF_SIZE]);
snprintf(pRule.get(), MAX_LOCAL_BUF_SIZE, "path='%s',type='signal',interface='%s'", DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str());
- LOGD("rule : %s" ,pRule.get());
+
dbus_bus_add_match(m_pDBusConnection, pRule.get(), &error);
TryReturn(!dbus_error_is_set(&error), PRIV_MGR_ERROR_SYSTEM_ERROR, dbus_error_free(&error), "dbus_bus_add_match : %s", error.message);
@@ -74,7 +74,7 @@ NotificationServer::notifySettingChanged(const std::string pkgId, const std::str char* pPkgId = const_cast <char*> (pkgId.c_str());
char* pPrivacyId = const_cast <char*> (privacyId.c_str());
- LOGD("path: %s, inter: %s, name: %s", DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_SETTING_CHANGED.c_str());
+
DBusMessage* pMessage = dbus_message_new_signal(DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_SETTING_CHANGED.c_str());
TryReturn(pMessage != NULL, PRIV_MGR_ERROR_IPC_ERROR, , "dbus_message_new_signal");
@@ -105,7 +105,7 @@ NotificationServer::notifyPkgRemoved(const std::string pkgId) return PRIV_MGR_ERROR_INVALID_STATE;
char* pPkgId = const_cast <char*> (pkgId.c_str());
- LOGD("path: %s, inter: %s, name: %s", DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_PKG_REMOVED.c_str());
+
DBusMessage* pMessage = dbus_message_new_signal(DBUS_PATH.c_str(), DBUS_SIGNAL_INTERFACE.c_str(), DBUS_SIGNAL_PKG_REMOVED.c_str());
TryReturn(pMessage != NULL, PRIV_MGR_ERROR_IPC_ERROR, , "dbus_message_new_signal");
diff --git a/server/src/PrivacyManagerServer.cpp b/server/src/PrivacyManagerServer.cpp index 85f38b4..e6b2a4b 100644 --- a/server/src/PrivacyManagerServer.cpp +++ b/server/src/PrivacyManagerServer.cpp @@ -33,8 +33,6 @@ PrivacyManagerServer::createDB(void) int
PrivacyManagerServer::setPrivacySetting(const std::string pkgId, const std::string privacyId, bool enabled)
{
- LOGD("Set Privacy: %s, %s, %d", pkgId.c_str(), privacyId.c_str(), enabled);
-
int res = PrivacyDb::getInstance()->setPrivacySetting(pkgId, privacyId, enabled);
TryReturn( res == PRIV_MGR_ERROR_SUCCESS, res, , "privacyDb::setPrivacySetting : %d", res);
|