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 78261b5a567b992db7d28c0c11a0877388a67725..8b7e045bbf8ab06f2d8abaec2cf283f2e96db5fc 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 2c6c4bddfc00b36a6acfa6c561ea0d3772305ea3..3c9fbc1b0b2da1a89c84540c32a547b97c9d3c63 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 3513854dbd1079f2b03a04a5f347c5b4da112648..2b8bb3f0f72312bfeb35edb03ffc1958a941c3ed 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 85759bee8f3577fc665dd87b99d7666b5011d3b6..767a52382f2a286c8cfc81a26ced87b0fbfccde0 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 dc3d616814f14d2125173f77607f1671b8b1cb83..24c1f0c4ece6f80c1c95dc235c4b098acec72be6 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 79b5e6ba6d4bed9b9ebbb618ebdcbcb94dd3f898..7fc03dc30adc20a2ae462f5ab604569c1d639ef9 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 13cf5c75ce3f9ab1b9be7e6b1a7c7dde772ef76c..3bfe074213113c8acef88c1ab63e3d467cab320d 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 da65fe5cadf3da2ce6a19e0e65387e0dc3c37985..623f8c91d9523982100f9c4d7479795e818ddaee 100644 (file)
@@ -32,6 +32,7 @@ namespace ctx {
                int unsubscribe();
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                time_t __latestMyProfile;
index 2f09c53f9d7635f220348a8d978c0e1b447f7fde..17a096e834c3c4a5c2da9de1823c87a101c86786 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 fe2a41675c3ea2aa7ddd018fb7b91cd8185f269f..c09ea1d40a64fec20dc15000d0fc40e9329ffaf1 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 44021d848a5374fb6cc7a74a491221812875d8ec..75fc3263eb7ccf0f139275effb3e49e0ac603636 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 eb273f9465fd3caa701b3484f0dcd7f420ae0fae..60b8f124f7cabceb756b6d7a1dd2e1d4d7c1540a 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 daa13495e71346264235c3eb707ab517376a404d..ed056403b38c5c80e6f44a6c3d9e4af6e5df5e72 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 bb27e47448ac9230bef50677df240cad90cab663..26a32cc6d4a835d10be598e562ed940b0fcb4c79 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 32a484b30529fe2252a14ab56a328f446106f2bc..787c89f467c3d1d7cb4d7644cfaa99a16249cd27 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 576ce2fa708be390fecca8bdec848f1ba7df753b..e46eff3a16550f4aaeb01346f41858e95c71857b 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 789c2dab5f961009902c71d35dc81a6cd3b17ed7..3d90c6acbe4ea1e79b9b468e18437bf96549c5cb 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 9eda4ac1c6891f85e3a51945b1b060a8501d6138..fe90094fe7e1f2ca262e8c141415b6d8ce84c6f8 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 753588e209d905d105e342bd39405bbba1f65d0b..6e1b869dc8f686f79bf2a78d00f8f2b5cc95bd7f 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 5f5cc9b72a324acf332fe05253e901897e6c066a..3d15128bb2b84cfea9be1d9966ca24273b8cfcb4 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 a93978a1fa4588abbe5221ffe8f75058142805a0..22d46b524027ef8b8e75fd78a05a02bb1f3f9b61 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 19fbde2c2a4cb30974c8529622765e45a9c6640d..79893f2b7d5152aa8465773dadcc96191e38435f 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 e3efec67925e7f5ecbc95f63cb9f3e77dfcbfa68..0d25628b285967db8ebe0c7c6aafbadde8d6319b 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 1a21de2177cec78ea237ec2957d82728071483ca..c0eb946e91f80b37a28bec9d9c9577d41294aa3e 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 4a1db85768c1e24681794f31b8fc40ec13b57b2f..ff501bf14c0289d7f6309c2cd0b23cf01746ee27 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 0446af4e180e0e2480379753e36b29bb6b2ae641..22695ca4062b94028cc6bc91c9a8080188d3467b 100644 (file)
@@ -34,6 +34,7 @@ namespace ctx {
                int read();
 
                bool isSupported();
+               void getPrivilege(std::vector<const char*> &privilege);
 
        private:
                enum InternalState {