Implement getPrivilege() functions 28/67528/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 27 Apr 2016 07:17:21 +0000 (16:17 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 27 Apr 2016 07:17:21 +0000 (16:17 +0900)
Change-Id: I7fc00fe8c1542d4943376f92b7d36c7c926533e7
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
26 files changed:
src/app-stats/AppStatsLogger.cpp
src/app-stats/AppStatsLogger.h
src/app-stats/AppStatsProvider.cpp
src/app-stats/AppStatsProvider.h
src/call/Call.cpp
src/call/Call.h
src/contacts/Contacts.cpp
src/contacts/Contacts.h
src/geofence/PlaceGeofenceProvider.cpp
src/geofence/PlaceGeofenceProvider.h
src/media-stats/MediaStatsLogger.cpp
src/media-stats/MediaStatsLogger.h
src/media-stats/MediaStatsProvider.cpp
src/media-stats/MediaStatsProvider.h
src/message/Message.cpp
src/message/Message.h
src/my-place/place_recognition.cpp
src/my-place/place_recognition.h
src/social-stats/SocialStatsLogger.cpp
src/social-stats/SocialStatsLogger.h
src/social-stats/SocialStatsProvider.cpp
src/social-stats/SocialStatsProvider.h
src/time/Alarm.cpp
src/time/Alarm.h
src/wifi/Wifi.cpp
src/wifi/Wifi.h

index 78261b5..8b7e045 100644 (file)
@@ -46,6 +46,11 @@ AppStatsLogger::~AppStatsLogger()
        delete __launchMon;
 }
 
+void AppStatsLogger::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_APP_HISTORY);
+}
+
 int AppStatsLogger::subscribe(Json option, Json* requestResult)
 {
        return ERR_NONE;
index 2c6c4bd..3c9fbc1 100644 (file)
@@ -32,6 +32,8 @@ namespace ctx {
                int subscribe(Json option, Json *requestResult);
                int unsubscribe(Json option);
 
+               void getPrivilege(std::vector<const char*> &privilege);
+
        private:
                AppDbInitializer *__initializer;
                AppInstallMonitor *__installMon;
index 3513854..2b8bb3f 100644 (file)
@@ -28,6 +28,11 @@ AppStatsProvider::~AppStatsProvider()
 {
 }
 
+void AppStatsProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_APP_HISTORY);
+}
+
 int AppStatsProvider::read(Json option, Json *requestResult)
 {
        AppDbHandle *handle = new(std::nothrow) AppDbHandle(this);
index 85759be..767a523 100644 (file)
@@ -25,6 +25,7 @@ namespace ctx {
        class AppStatsProvider : public ContextProvider {
        public:
                int read(Json option, Json *requestResult);
+               void getPrivilege(std::vector<const char*> &privilege);
 
        protected:
                AppStatsProvider(const char *subject);
index dc3d616..24c1f0c 100644 (file)
@@ -49,6 +49,11 @@ CallStateProvider::~CallStateProvider()
 {
 }
 
+void CallStateProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_TELEPHONY);
+}
+
 bool CallStateProvider::isSupported()
 {
        return util::getSystemInfoBool("tizen.org/feature/network.telephony");
index 79b5e6b..7fc03dc 100644 (file)
@@ -33,6 +33,7 @@ namespace ctx {
                int read();
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                telephony_handle_list_s __handleList;
index 13cf5c7..3bfe074 100644 (file)
@@ -33,6 +33,11 @@ ContactsChangeProvider::~ContactsChangeProvider()
 {
 }
 
+void ContactsChangeProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_CONTACT);
+}
+
 bool ContactsChangeProvider::isSupported()
 {
        return true;
index da65fe5..623f8c9 100644 (file)
@@ -32,6 +32,7 @@ namespace ctx {
                int unsubscribe();
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                time_t __latestMyProfile;
index 2f09c53..17a096e 100644 (file)
@@ -34,6 +34,11 @@ PlaceGeofenceProvider::~PlaceGeofenceProvider()
        __handleMap.clear();
 }
 
+void PlaceGeofenceProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_LOCATION);
+}
+
 bool PlaceGeofenceProvider::isSupported()
 {
        bool supported = false;
index fe2a416..c09ea1d 100644 (file)
@@ -34,6 +34,7 @@ namespace ctx {
                int unsubscribe(Json option);
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                std::map<int, GeofenceMonitorHandle*> __handleMap;
index 44021d8..75fc326 100644 (file)
@@ -28,6 +28,11 @@ MediaStatsLogger::~MediaStatsLogger()
 {
 }
 
+void MediaStatsLogger::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_MEDIA_HISTORY);
+}
+
 int MediaStatsLogger::subscribe(Json option, Json* requestResult)
 {
        return ERR_NONE;
index eb273f9..60b8f12 100644 (file)
@@ -29,6 +29,7 @@ namespace ctx {
 
                int subscribe(Json option, Json *requestResult);
                int unsubscribe(Json option);
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                MediaContentMonitor __contentMon;
index daa1349..ed05640 100644 (file)
@@ -28,6 +28,11 @@ MediaStatsProvider::~MediaStatsProvider()
 {
 }
 
+void MediaStatsProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_MEDIA_HISTORY);
+}
+
 bool MediaStatsProvider::isSupported()
 {
        /* TODO */
index bb27e47..26a32cc 100644 (file)
@@ -26,6 +26,7 @@ namespace ctx {
        public:
                int read(Json option, Json* requestResult);
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        protected:
                MediaStatsProvider(const char *subject);
index 32a484b..787c89f 100644 (file)
@@ -31,6 +31,11 @@ MessageEventProvider::~MessageEventProvider()
 {
 }
 
+void MessageEventProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_MESSAGE);
+}
+
 bool MessageEventProvider::isSupported()
 {
        return util::getSystemInfoBool("tizen.org/feature/network.telephony");
index 576ce2f..e46eff3 100644 (file)
@@ -32,6 +32,7 @@ namespace ctx {
                int subscribe();
                int unsubscribe();
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                msg_handle_t __messageHandle;
index 789c2da..3d90c6a 100644 (file)
 #include "place_recognition.h"
 #include "user_places/user_places.h"
 
+void ctx::PlaceRecognitionProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_LOCATION);
+       privilege.push_back(PRIV_NETWORK);
+}
+
 int ctx::PlaceRecognitionProvider::subscribe(ctx::Json option, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
index 9eda4ac..fe90094 100644 (file)
@@ -37,6 +37,7 @@ namespace ctx {
                int write(ctx::Json data, ctx::Json *requestResult);
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                UserPlaces __engine;
index 753588e..6e1b869 100644 (file)
@@ -28,6 +28,11 @@ SocialStatsLogger::~SocialStatsLogger()
 {
 }
 
+void SocialStatsLogger::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_CALL_HISTORY);
+}
+
 int SocialStatsLogger::subscribe(Json option, Json* requestResult)
 {
        return ERR_NONE;
index 5f5cc9b..3d15128 100644 (file)
@@ -29,6 +29,7 @@ namespace ctx {
 
                int subscribe(Json option, Json* requestResult);
                int unsubscribe(Json option);
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                ContactLogAggregator __aggregator;
index a93978a..22d46b5 100644 (file)
@@ -28,6 +28,11 @@ SocialStatsProvider::~SocialStatsProvider()
 {
 }
 
+void SocialStatsProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_CALL_HISTORY);
+}
+
 bool SocialStatsProvider::isSupported()
 {
        /* TODO */
index 19fbde2..79893f2 100644 (file)
@@ -26,6 +26,7 @@ namespace ctx {
        public:
                int read(Json option, Json* requestResult);
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        protected:
                SocialStatsProvider(const char *subject);
index e3efec6..0d25628 100644 (file)
@@ -33,6 +33,11 @@ AlarmProvider::~AlarmProvider()
        __optionSet.clear();
 }
 
+void AlarmProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_ALARM);
+}
+
 bool AlarmProvider::isSupported()
 {
        return true;
index 1a21de2..c0eb946 100644 (file)
@@ -34,6 +34,7 @@ namespace ctx {
                int unsubscribe(Json option);
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        protected:
                bool onTimerExpired(int timerId);
index 4a1db85..ff501bf 100644 (file)
@@ -40,6 +40,11 @@ WifiStateProvider::~WifiStateProvider()
        __stopMonitor();
 }
 
+void WifiStateProvider::getPrivilege(std::vector<const char*> &privilege)
+{
+       privilege.push_back(PRIV_NETWORK);
+}
+
 bool WifiStateProvider::isSupported()
 {
        return util::getSystemInfoBool("tizen.org/feature/network.wifi");
index 0446af4..22695ca 100644 (file)
@@ -34,6 +34,7 @@ namespace ctx {
                int read();
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                enum InternalState {