modify logs
[platform/core/security/privacy-manager.git] / server / src / service / PrivacyInfoService.cpp
index a8bbbe6..bffda01 100644 (file)
-/*\r
- * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved\r
- *\r
- *    Licensed under the Apache License, Version 2.0 (the "License");\r
- *    you may not use this file except in compliance with the License.\r
- *    You may obtain a copy of the License at\r
- *\r
- *        http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- *    Unless required by applicable law or agreed to in writing, software\r
- *    distributed under the License is distributed on an "AS IS" BASIS,\r
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *    See the License for the specific language governing permissions and\r
- *    limitations under the License.\r
- */\r
-\r
-#include <PrivacyInfoService.h>\r
-#include <PrivacyManagerServer.h>\r
-#include <dlog.h>\r
-#include <Utils.h>\r
-\r
-void\r
-PrivacyInfoService::addPrivacyInfo(SocketConnection* pConnector)\r
-{\r
-       LOGI("enter");\r
-\r
-       std::string pkgId;\r
-       std::list < std::string > list;\r
-       bool privacyPopupRequired = true;\r
-       pConnector->read(&pkgId, &list, &privacyPopupRequired);\r
-\r
-       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();\r
-       int result = pPrivacyManagerServer->addAppPackagePrivacyInfo(pkgId, list, privacyPopupRequired);\r
-\r
-       pConnector->write(result);\r
-}\r
-\r
-void\r
-PrivacyInfoService::removePrivacyInfo(SocketConnection* pConnector)\r
-{\r
-       LOGI("enter");\r
-\r
-       std::string pkgId;\r
-       pConnector->read(&pkgId);\r
-\r
-       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();\r
-       int res = pPrivacyManagerServer->removeAppPackagePrivacyInfo(pkgId);\r
-\r
-       pConnector->write(res);\r
-}\r
-\r
-void\r
-PrivacyInfoService::setPrivacySetting(SocketConnection* pConnector)\r
-{\r
-       LOGI("enter");\r
-\r
-       std::string pkgId;\r
-       std::string privacyId;\r
-       bool enabled = false;\r
-       pConnector->read(&pkgId, &privacyId, &enabled);\r
-\r
-       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();\r
-       int result = pPrivacyManagerServer->setPrivacySetting(pkgId, privacyId, enabled);\r
-\r
-       pConnector->write(result);\r
-}\r
-\r
-void\r
-PrivacyInfoService::getPrivacyAppPackages(SocketConnection* pConnector)\r
-{\r
-       LOGI("enter");\r
-       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();\r
-       std::list <std::string> list;\r
-       int result = pPrivacyManagerServer->getPrivacyAppPackages(list);\r
-\r
-       pConnector->write( (unsigned int) result);\r
-       pConnector->write( (unsigned int) list.size());\r
-       pConnector->write(list);\r
-}\r
-\r
-void\r
-PrivacyInfoService::getAppPackagePrivacyInfo(SocketConnection* pConnector)\r
-{\r
-       LOGI("enter");\r
-\r
-       std::string pkgId;\r
-\r
-       pConnector->read(&pkgId);\r
-       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();\r
-\r
-       \r
-       std::list < std::pair < std::string, bool > > infoList;\r
-       \r
-       int res = pPrivacyManagerServer->getAppPackagePrivacyInfo(pkgId, infoList);\r
-\r
-       pConnector->write( res );\r
-       pConnector->write( infoList );\r
-}\r
-\r
-void\r
-PrivacyInfoService::isUserPrompted(SocketConnection* pConnector)\r
-{\r
-       LOGI("enter");\r
-\r
-       std::string pkgId;\r
-\r
-       pConnector->read(&pkgId);\r
-       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();\r
-\r
-       bool isPrompted;\r
-       int res = pPrivacyManagerServer->isUserPrompted(pkgId, isPrompted);\r
-\r
-       pConnector->write( res );\r
-       pConnector->write( isPrompted );\r
-\r
-       LOGI("leave");\r
-}\r
-\r
-void\r
-PrivacyInfoService::setUserPrompted(SocketConnection* pConnector)\r
-{\r
-       LOGI("enter");\r
-\r
-       std::string pkgId;\r
-       bool prompted = false;\r
-\r
-       pConnector->read(&pkgId, &prompted);\r
-       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();\r
-\r
-       int res = pPrivacyManagerServer->setUserPrompted(pkgId, prompted);\r
-       LOGI("write");\r
-       pConnector->write( res );\r
-\r
-       LOGI("leave");\r
-}
\ No newline at end of file
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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 <PrivacyInfoService.h>
+#include <PrivacyManagerServer.h>
+#include <dlog.h>
+#include <Utils.h>
+
+void
+PrivacyInfoService::addPrivacyInfo(SocketConnection* pConnector)
+{
+       std::string pkgId;
+       std::list < std::string > list;
+       bool privacyPopupRequired = true;
+       pConnector->read(&pkgId, &list, &privacyPopupRequired);
+
+       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();
+       int result = pPrivacyManagerServer->addAppPackagePrivacyInfo(pkgId, list, privacyPopupRequired);
+
+       pConnector->write(result);
+}
+
+void
+PrivacyInfoService::removePrivacyInfo(SocketConnection* pConnector)
+{
+       std::string pkgId;
+       pConnector->read(&pkgId);
+
+       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();
+       int res = pPrivacyManagerServer->removeAppPackagePrivacyInfo(pkgId);
+
+       pConnector->write(res);
+}
+
+void
+PrivacyInfoService::setPrivacySetting(SocketConnection* pConnector)
+{
+       std::string pkgId;
+       std::string privacyId;
+       bool enabled = false;
+       pConnector->read(&pkgId, &privacyId, &enabled);
+
+       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();
+       int result = pPrivacyManagerServer->setPrivacySetting(pkgId, privacyId, enabled);
+
+       pConnector->write(result);
+}
+
+void
+PrivacyInfoService::getPrivacyAppPackages(SocketConnection* pConnector)
+{
+       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();
+       std::list <std::string> list;
+       int result = pPrivacyManagerServer->getPrivacyAppPackages(list);
+
+       pConnector->write( (unsigned int) result);
+       pConnector->write( (unsigned int) list.size());
+       pConnector->write(list);
+}
+
+void
+PrivacyInfoService::getAppPackagePrivacyInfo(SocketConnection* pConnector)
+{
+       std::string pkgId;
+
+       pConnector->read(&pkgId);
+       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();
+
+       
+       std::list < std::pair < std::string, bool > > infoList;
+       
+       int res = pPrivacyManagerServer->getAppPackagePrivacyInfo(pkgId, infoList);
+
+       pConnector->write( res );
+       pConnector->write( infoList );
+}
+
+void
+PrivacyInfoService::isUserPrompted(SocketConnection* pConnector)
+{
+       std::string pkgId;
+
+       pConnector->read(&pkgId);
+       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();
+
+       bool isPrompted;
+       int res = pPrivacyManagerServer->isUserPrompted(pkgId, isPrompted);
+
+       pConnector->write( res );
+       pConnector->write( isPrompted );
+
+}
+
+void
+PrivacyInfoService::setUserPrompted(SocketConnection* pConnector)
+{
+       std::string pkgId;
+       bool prompted = false;
+
+       pConnector->read(&pkgId, &prompted);
+       PrivacyManagerServer* pPrivacyManagerServer = PrivacyManagerServer::getInstance();
+
+       int res = pPrivacyManagerServer->setUserPrompted(pkgId, prompted);
+       LOGI("write");
+       pConnector->write( res );
+
+}