Apply Tizen C++ coding style based on context-common changes 91/64591/2
authorSomin Kim <somin926.kim@samsung.com>
Mon, 4 Apr 2016 04:21:59 +0000 (13:21 +0900)
committerSomin Kim <somin926.kim@samsung.com>
Mon, 4 Apr 2016 05:54:20 +0000 (14:54 +0900)
- ContextManager, IContextManager, ContextProviderBase(context_provider_iface)

Change-Id: Icfbdfaaf570a98aba2115cb3c169722a3f01b7ab
Signed-off-by: Somin Kim <somin926.kim@samsung.com>
53 files changed:
include/custom_context_provider.h
src/custom/custom_base.cpp
src/custom/custom_base.h
src/custom/custom_context_provider.cpp
src/device/activity/activity.h
src/device/activity/activity_base.cpp
src/device/activity/activity_base.h
src/device/device_context_provider.cpp
src/device/device_provider_base.cpp [new file with mode: 0644]
src/device/device_provider_base.h [new file with mode: 0644]
src/device/provider_base.cpp [deleted file]
src/device/provider_base.h [deleted file]
src/device/social/call.cpp
src/device/social/call.h
src/device/social/contacts.cpp
src/device/social/contacts.h
src/device/social/email.cpp
src/device/social/email.h
src/device/social/message.cpp
src/device/social/message.h
src/device/system/alarm.cpp
src/device/system/alarm.h
src/device/system/battery.cpp
src/device/system/battery.h
src/device/system/headphone.cpp
src/device/system/headphone.h
src/device/system/psmode.cpp
src/device/system/psmode.h
src/device/system/runtime-info/base_rtinfo.h
src/device/system/runtime-info/charger.cpp
src/device/system/runtime-info/gps.cpp
src/device/system/runtime-info/usb.cpp
src/device/system/time.cpp
src/device/system/time.h
src/device/system/wifi.cpp
src/device/system/wifi.h
src/place/geofence/myplace_handle.cpp
src/place/geofence/place_geofence.cpp
src/place/geofence/place_geofence.h
src/place/place_context_provider.cpp
src/place/recognition/place_recognition.cpp
src/place/recognition/place_recognition.h
src/statistics/app/app_stats_provider.cpp
src/statistics/app/app_stats_provider.h
src/statistics/app/db_handle.cpp
src/statistics/media/db_handle.cpp
src/statistics/media/media_stats_provider.cpp
src/statistics/media/media_stats_provider.h
src/statistics/shared/db_handle_base.cpp
src/statistics/social/db_handle.cpp
src/statistics/social/social_stats_provider.cpp
src/statistics/social/social_stats_provider.h
src/statistics/statistics_context_provider.cpp

index 17c8cc4f7df9209fd17066b0117719d72364654d..918dfa605f67b6ae8ab2df80c30b15babc0ed1e4 100644 (file)
@@ -21,11 +21,11 @@ namespace ctx {
        bool init_custom_context_provider();
 
        namespace custom_context_provider {
-       int add_item(std::string subject, std::string name, ctx::Json tmpl, const char* owner, bool is_init = false);
-       int remove_item(std::string subject);
-       int publish_data(std::string subject, ctx::Json fact);
+       int addItem(std::string subject, std::string name, ctx::Json tmpl, const char* owner, bool is_init = false);
+       int removeItem(std::string subject);
+       int publishData(std::string subject, ctx::Json fact);
 
-       context_provider_iface* create(void* data);
+       ContextProviderBase* create(void* data);
        void destroy(void* data);
        }
 }
index c5ac58d3fe7973fc2e7407721ad14f4b34df66ca..43712023be80a15bb47aa3eb32cf3799f7db4b02 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "custom_base.h"
 
 ctx::custom_base::custom_base(std::string subject, std::string name, ctx::Json tmpl, std::string owner) :
@@ -36,16 +36,16 @@ bool ctx::custom_base::is_supported()
 
 void ctx::custom_base::submit_trigger_item()
 {
-       context_manager::register_trigger_item(_subject.c_str(), OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(_subject.c_str(), OPS_SUBSCRIBE | OPS_READ,
                        _tmpl.str(), NULL, _owner.c_str());
 }
 
 void ctx::custom_base::unsubmit_trigger_item()
 {
-       context_manager::unregister_trigger_item(_subject.c_str());
+       context_manager::unregisterTriggerItem(_subject.c_str());
 }
 
-int ctx::custom_base::subscribe(const char *subject, ctx::Json option, ctx::Json *request_result)
+int ctx::custom_base::subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult)
 {
        return ERR_NONE;
 
@@ -56,14 +56,14 @@ int ctx::custom_base::unsubscribe(const char *subject, ctx::Json option)
        return ERR_NONE;
 }
 
-int ctx::custom_base::read(const char *subject, ctx::Json option, ctx::Json *request_result)
+int ctx::custom_base::read(const char *subject, ctx::Json option, ctx::Json *requestResult)
 {
        ctx::Json data = latest.str();
-       ctx::context_manager::reply_to_read(_subject.c_str(), NULL, ERR_NONE, data);
+       ctx::context_manager::replyToRead(_subject.c_str(), NULL, ERR_NONE, data);
        return ERR_NONE;
 }
 
-int ctx::custom_base::write(const char *subject, ctx::Json data, ctx::Json *request_result)
+int ctx::custom_base::write(const char *subject, ctx::Json data, ctx::Json *requestResult)
 {
        return ERR_NONE;
 }
index 0278e0f08e590bb1b87c8249255df2c0f37ce460..68e45ccaeb44559e2233a423af424ab8d59b289d 100644 (file)
 #define _CUSTOM_BASE_H_
 
 #include <Json.h>
-#include <provider_iface.h>
+#include <ContextProviderBase.h>
 #include <types_internal.h>
 
 namespace ctx {
 
-       class custom_base : public context_provider_iface {
+       class custom_base : public ContextProviderBase {
        public:
                custom_base(std::string subject, std::string name, ctx::Json tmpl, std::string owner);
                ~custom_base();
 
-               int subscribe(const char *subject, ctx::Json option, ctx::Json *request_result);
+               int subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult);
                int unsubscribe(const char *subject, ctx::Json option);
-               int read(const char *subject, ctx::Json option, ctx::Json *request_result);
-               int write(const char *subject, ctx::Json data, ctx::Json *request_result);
+               int read(const char *subject, ctx::Json option, ctx::Json *requestResult);
+               int write(const char *subject, ctx::Json data, ctx::Json *requestResult);
 
                static bool is_supported();
                void submit_trigger_item();
index 29c91004027669a6ca5f55a5e5222af9b2a1cbea..88aca00fc05cc9f6164797e5afce5c770badf5b5 100644 (file)
@@ -17,8 +17,8 @@
 #include <map>
 #include <vector>
 #include <types_internal.h>
-#include <context_mgr.h>
-#include <provider_iface.h>
+#include <ContextManager.h>
+#include <ContextProviderBase.h>
 #include <db_mgr.h>
 #include <custom_context_provider.h>
 #include "custom_base.h"
@@ -29,24 +29,24 @@ static bool is_valid_fact(std::string subject, ctx::Json& fact);
 static bool check_value_int(ctx::Json& tmpl, std::string key, int value);
 static bool check_value_string(ctx::Json& tmpl, std::string key, std::string value);
 
-void register_provider(const char *subject, const char *privilege)
+void registerProvider(const char *subject, const char *privilege)
 {
-       ctx::context_provider_info provider_info(ctx::custom_context_provider::create,
+       ctx::ContextProviderInfo providerInfo(ctx::custom_context_provider::create,
                                                                                        ctx::custom_context_provider::destroy,
                                                                                        const_cast<char*>(subject), privilege);
-       ctx::context_manager::register_provider(subject, provider_info);
+       ctx::context_manager::registerProvider(subject, providerInfo);
        custom_map[subject]->submit_trigger_item();
 }
 
-void unregister_provider(const char* subject)
+void unregisterProvider(const char* subject)
 {
        custom_map[subject]->unsubmit_trigger_item();
-       ctx::context_manager::unregister_provider(subject);
+       ctx::context_manager::unregisterProvider(subject);
 }
 
-EXTAPI ctx::context_provider_iface* ctx::custom_context_provider::create(void *data)
+EXTAPI ctx::ContextProviderBase* ctx::custom_context_provider::create(void *data)
 {
-       // Already created in add_item() function. Return corresponding custom provider
+       // Already created in addItem() function. Return corresponding custom provider
        return custom_map[static_cast<const char*>(data)];
 }
 
@@ -89,7 +89,7 @@ EXTAPI bool ctx::init_custom_context_provider()
                elem.get(NULL, "attributes", &attributes);
                elem.get(NULL, "owner", &owner);
 
-               error = ctx::custom_context_provider::add_item(subject, name, ctx::Json(attributes), owner.c_str(), true);
+               error = ctx::custom_context_provider::addItem(subject, name, ctx::Json(attributes), owner.c_str(), true);
                if (error != ERR_NONE) {
                        _E("Failed to add custom item(%s): %#x", subject.c_str(), error);
                }
@@ -98,7 +98,7 @@ EXTAPI bool ctx::init_custom_context_provider()
        return true;
 }
 
-EXTAPI int ctx::custom_context_provider::add_item(std::string subject, std::string name, ctx::Json tmpl, const char* owner, bool is_init)
+EXTAPI int ctx::custom_context_provider::addItem(std::string subject, std::string name, ctx::Json tmpl, const char* owner, bool is_init)
 {
        std::map<std::string, ctx::custom_base*>::iterator it;
        it = custom_map.find(subject);
@@ -116,7 +116,7 @@ EXTAPI int ctx::custom_context_provider::add_item(std::string subject, std::stri
        IF_FAIL_RETURN_TAG(custom, ERR_OUT_OF_MEMORY, _E, "Memory allocation failed");
        custom_map[subject] = custom;
 
-       register_provider(custom->get_subject(), NULL);
+       registerProvider(custom->get_subject(), NULL);
 
        // Add item to custom template db
        if (!is_init) {
@@ -130,13 +130,13 @@ EXTAPI int ctx::custom_context_provider::add_item(std::string subject, std::stri
        return ERR_NONE;
 }
 
-EXTAPI int ctx::custom_context_provider::remove_item(std::string subject)
+EXTAPI int ctx::custom_context_provider::removeItem(std::string subject)
 {
        std::map<std::string, ctx::custom_base*>::iterator it;
        it = custom_map.find(subject);
        IF_FAIL_RETURN_TAG(it != custom_map.end(), ERR_NOT_SUPPORTED, _E, "%s not supported", subject.c_str());
 
-       unregister_provider(subject.c_str());
+       unregisterProvider(subject.c_str());
 
        // Remove item from custom template db
        std::string q = "DELETE FROM context_trigger_custom_template WHERE subject = '" + subject + "'";
@@ -147,7 +147,7 @@ EXTAPI int ctx::custom_context_provider::remove_item(std::string subject)
        return ERR_NONE;
 }
 
-EXTAPI int ctx::custom_context_provider::publish_data(std::string subject, ctx::Json fact)
+EXTAPI int ctx::custom_context_provider::publishData(std::string subject, ctx::Json fact)
 {
        std::map<std::string, ctx::custom_base*>::iterator it;
        it = custom_map.find(subject);
index d0e09513192b79b874f3c4778f464fa62a899366..2f44267c791faec180277ae3da1b3dc58057b755 100644 (file)
@@ -23,7 +23,7 @@
 #define GENERATE_ACTIVITY_PROVIDER(act_prvd, act_subj, act_type) \
        class act_prvd : public user_activity_base { \
        public: \
-               static context_provider_iface *create(void *data) \
+               static ContextProviderBase *create(void *data) \
                { \
                        CREATE_INSTANCE(ctx::act_prvd); \
                } \
@@ -37,7 +37,7 @@
                } \
                static void submit_trigger_item() \
                { \
-                       context_manager::register_trigger_item((act_subj), OPS_SUBSCRIBE, \
+                       context_manager::registerTriggerItem((act_subj), OPS_SUBSCRIBE, \
                                        "{\"Event\":{\"type\":\"string\", \"values\":[\"Detected\"]}}", \
                                        "{\"Accuracy\":{\"type\":\"string\", \"values\":[\"Low\", \"Normal\", \"High\"]}}" \
                                        ); \
index e0a902784b85963e533c9f4b55a98bcb84a7ef4d..30201caa24c5fe9aebb2bd0bd063e08aa34f6cfd 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <types_internal.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "activity_types.h"
 #include "activity_base.h"
 
@@ -44,25 +44,25 @@ void ctx::user_activity_base::handle_event(activity_type_e activity, const activ
 {
        IF_FAIL_VOID_TAG(activity == activity_type, _E, "Invalid activity: %d", activity);
 
-       ctx::Json data_read;
-       data_read.set(NULL, USER_ACT_EVENT, USER_ACT_DETECTED);
+       ctx::Json dataRead;
+       dataRead.set(NULL, USER_ACT_EVENT, USER_ACT_DETECTED);
 
        activity_accuracy_e accuracy = ACTIVITY_ACCURACY_LOW;
        activity_get_accuracy(data, &accuracy);
 
        switch (accuracy) {
        case ACTIVITY_ACCURACY_HIGH:
-               data_read.set(NULL, USER_ACT_ACCURACY, USER_ACT_HIGH);
+               dataRead.set(NULL, USER_ACT_ACCURACY, USER_ACT_HIGH);
                break;
        case ACTIVITY_ACCURACY_MID:
-               data_read.set(NULL, USER_ACT_ACCURACY, USER_ACT_NORMAL);
+               dataRead.set(NULL, USER_ACT_ACCURACY, USER_ACT_NORMAL);
                break;
        default:
-               data_read.set(NULL, USER_ACT_ACCURACY, USER_ACT_LOW);
+               dataRead.set(NULL, USER_ACT_ACCURACY, USER_ACT_LOW);
                break;
        }
 
-       context_manager::publish(subject.c_str(), NULL, ERR_NONE, data_read);
+       context_manager::publish(subject.c_str(), NULL, ERR_NONE, dataRead);
 }
 
 int ctx::user_activity_base::subscribe()
index 45fcc8dc4b5de33e1e8a923ed9e0e0b835b2c138..05fa503b199629f05f1b691cc7886fd5c996fba0 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <string>
 #include <activity_recognition.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index be6d9110e92d7157de762c5f03791db02e366508..39fcf7d13bea30a5c46d3921539d44065b3fd45c 100644 (file)
@@ -15,8 +15,8 @@
  */
 
 #include <types_internal.h>
-#include <context_mgr.h>
-#include <provider_iface.h>
+#include <ContextManager.h>
+#include <ContextProviderBase.h>
 #include <device_context_provider.h>
 
 #include "system/system_types.h"
 #define PRIV_CONTACT   "contact.read"
 
 template<typename provider>
-void register_provider(const char *subject, const char *privilege)
+void registerProvider(const char *subject, const char *privilege)
 {
        if (!provider::is_supported())
                return;
 
-       ctx::context_provider_info provider_info(provider::create, provider::destroy, NULL, privilege);
-       ctx::context_manager::register_provider(subject, provider_info);
+       ctx::ContextProviderInfo providerInfo(provider::create, provider::destroy, NULL, privilege);
+       ctx::context_manager::registerProvider(subject, providerInfo);
        provider::submit_trigger_item();
 }
 
 EXTAPI bool ctx::init_device_context_provider()
 {
-       register_provider<device_status_alarm>(DEVICE_ST_SUBJ_ALARM, NULL);
-       register_provider<device_status_time>(DEVICE_ST_SUBJ_TIME, NULL);
+       registerProvider<device_status_alarm>(DEVICE_ST_SUBJ_ALARM, NULL);
+       registerProvider<device_status_time>(DEVICE_ST_SUBJ_TIME, NULL);
 
 #ifdef _MOBILE_
-       register_provider<device_status_wifi>(DEVICE_ST_SUBJ_WIFI, PRIV_NETWORK);
-       register_provider<device_status_headphone>(DEVICE_ST_SUBJ_HEADPHONE, NULL);
+       registerProvider<device_status_wifi>(DEVICE_ST_SUBJ_WIFI, PRIV_NETWORK);
+       registerProvider<device_status_headphone>(DEVICE_ST_SUBJ_HEADPHONE, NULL);
 
-       register_provider<device_status_charger>(DEVICE_ST_SUBJ_CHARGER, NULL);
-       register_provider<device_status_gps>(DEVICE_ST_SUBJ_GPS, NULL);
-       register_provider<device_status_usb>(DEVICE_ST_SUBJ_USB, NULL);
-       register_provider<device_status_battery>(DEVICE_ST_SUBJ_BATTERY, NULL);
-       register_provider<device_status_psmode>(DEVICE_ST_SUBJ_PSMODE, NULL);
+       registerProvider<device_status_charger>(DEVICE_ST_SUBJ_CHARGER, NULL);
+       registerProvider<device_status_gps>(DEVICE_ST_SUBJ_GPS, NULL);
+       registerProvider<device_status_usb>(DEVICE_ST_SUBJ_USB, NULL);
+       registerProvider<device_status_battery>(DEVICE_ST_SUBJ_BATTERY, NULL);
+       registerProvider<device_status_psmode>(DEVICE_ST_SUBJ_PSMODE, NULL);
 
-       register_provider<social_status_call>(SOCIAL_ST_SUBJ_CALL, PRIV_TELEPHONY);
-       register_provider<social_status_email>(SOCIAL_ST_SUBJ_EMAIL, NULL);
-       register_provider<social_status_message>(SOCIAL_ST_SUBJ_MESSAGE, PRIV_MESSAGE);
-       register_provider<social_status_contacts>(SOCIAL_ST_SUBJ_CONTACTS, PRIV_CONTACT);
+       registerProvider<social_status_call>(SOCIAL_ST_SUBJ_CALL, PRIV_TELEPHONY);
+       registerProvider<social_status_email>(SOCIAL_ST_SUBJ_EMAIL, NULL);
+       registerProvider<social_status_message>(SOCIAL_ST_SUBJ_MESSAGE, PRIV_MESSAGE);
+       registerProvider<social_status_contacts>(SOCIAL_ST_SUBJ_CONTACTS, PRIV_CONTACT);
 
-       register_provider<user_activity_stationary>(USER_ACT_SUBJ_STATIONARY, NULL);
-       register_provider<user_activity_walking>(USER_ACT_SUBJ_WALKING, NULL);
-       register_provider<user_activity_running>(USER_ACT_SUBJ_RUNNING, NULL);
-       register_provider<user_activity_in_vehicle>(USER_ACT_SUBJ_IN_VEHICLE, NULL);
+       registerProvider<user_activity_stationary>(USER_ACT_SUBJ_STATIONARY, NULL);
+       registerProvider<user_activity_walking>(USER_ACT_SUBJ_WALKING, NULL);
+       registerProvider<user_activity_running>(USER_ACT_SUBJ_RUNNING, NULL);
+       registerProvider<user_activity_in_vehicle>(USER_ACT_SUBJ_IN_VEHICLE, NULL);
 
        /* Create context providers, which need to be initiated before being subscribed */
        if (device_status_wifi::is_supported())
@@ -106,22 +106,22 @@ EXTAPI bool ctx::init_device_context_provider()
 #endif
 
 #ifdef _WEARABLE_
-       register_provider<device_status_wifi>(DEVICE_ST_SUBJ_WIFI, PRIV_NETWORK);
-       register_provider<device_status_headphone>(DEVICE_ST_SUBJ_HEADPHONE, NULL);
+       registerProvider<device_status_wifi>(DEVICE_ST_SUBJ_WIFI, PRIV_NETWORK);
+       registerProvider<device_status_headphone>(DEVICE_ST_SUBJ_HEADPHONE, NULL);
 
-       register_provider<device_status_charger>(DEVICE_ST_SUBJ_CHARGER, NULL);
-       register_provider<device_status_gps>(DEVICE_ST_SUBJ_GPS, NULL);
-       register_provider<device_status_usb>(DEVICE_ST_SUBJ_USB, NULL);
-       register_provider<device_status_battery>(DEVICE_ST_SUBJ_BATTERY, NULL);
-       register_provider<device_status_psmode>(DEVICE_ST_SUBJ_PSMODE, NULL);
+       registerProvider<device_status_charger>(DEVICE_ST_SUBJ_CHARGER, NULL);
+       registerProvider<device_status_gps>(DEVICE_ST_SUBJ_GPS, NULL);
+       registerProvider<device_status_usb>(DEVICE_ST_SUBJ_USB, NULL);
+       registerProvider<device_status_battery>(DEVICE_ST_SUBJ_BATTERY, NULL);
+       registerProvider<device_status_psmode>(DEVICE_ST_SUBJ_PSMODE, NULL);
 
-       register_provider<social_status_call>(SOCIAL_ST_SUBJ_CALL, PRIV_TELEPHONY);
-       register_provider<social_status_message>(SOCIAL_ST_SUBJ_MESSAGE, PRIV_MESSAGE);
+       registerProvider<social_status_call>(SOCIAL_ST_SUBJ_CALL, PRIV_TELEPHONY);
+       registerProvider<social_status_message>(SOCIAL_ST_SUBJ_MESSAGE, PRIV_MESSAGE);
 
-       register_provider<user_activity_stationary>(USER_ACT_SUBJ_STATIONARY, NULL);
-       register_provider<user_activity_walking>(USER_ACT_SUBJ_WALKING, NULL);
-       register_provider<user_activity_running>(USER_ACT_SUBJ_RUNNING, NULL);
-       register_provider<user_activity_in_vehicle>(USER_ACT_SUBJ_IN_VEHICLE, NULL);
+       registerProvider<user_activity_stationary>(USER_ACT_SUBJ_STATIONARY, NULL);
+       registerProvider<user_activity_walking>(USER_ACT_SUBJ_WALKING, NULL);
+       registerProvider<user_activity_running>(USER_ACT_SUBJ_RUNNING, NULL);
+       registerProvider<user_activity_in_vehicle>(USER_ACT_SUBJ_IN_VEHICLE, NULL);
 
        /* Create context providers, which need to be initiated before being subscribed */
        if (device_status_wifi::is_supported())
@@ -129,8 +129,8 @@ EXTAPI bool ctx::init_device_context_provider()
 #endif
 
 #ifdef _TV_
-       register_provider<device_status_wifi>(DEVICE_ST_SUBJ_WIFI, PRIV_NETWORK);
-       register_provider<device_status_headphone>(DEVICE_ST_SUBJ_HEADPHONE, NULL);
+       registerProvider<device_status_wifi>(DEVICE_ST_SUBJ_WIFI, PRIV_NETWORK);
+       registerProvider<device_status_headphone>(DEVICE_ST_SUBJ_HEADPHONE, NULL);
 
        /* Create context providers, which need to be initiated before being subscribed */
        if (device_status_wifi::is_supported())
diff --git a/src/device/device_provider_base.cpp b/src/device/device_provider_base.cpp
new file mode 100644 (file)
index 0000000..95f3988
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * 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 <system_info.h>
+#include "device_provider_base.h"
+
+ctx::device_provider_base::device_provider_base()
+       : being_subscribed(false)
+{
+}
+
+int ctx::device_provider_base::subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult)
+{
+       IF_FAIL_RETURN(!being_subscribed, ERR_NONE);
+
+       int ret = subscribe();
+
+       if (ret == ERR_NONE)
+               being_subscribed = true;
+       else
+               destroy_self();
+
+       return ret;
+}
+
+int ctx::device_provider_base::unsubscribe(const char *subject, ctx::Json option)
+{
+       int ret = ERR_NONE;
+
+       if (being_subscribed)
+               ret = unsubscribe();
+
+       destroy_self();
+       return ret;
+}
+
+int ctx::device_provider_base::read(const char *subject, ctx::Json option, ctx::Json *requestResult)
+{
+       int ret = read();
+
+       if (!being_subscribed)
+               destroy_self();
+
+       return ret;
+}
+
+int ctx::device_provider_base::write(const char *subject, ctx::Json data, ctx::Json *requestResult)
+{
+       int ret = write();
+
+       if (!being_subscribed)
+               destroy_self();
+
+       return ret;
+}
+
+int ctx::device_provider_base::subscribe()
+{
+       return ERR_NOT_SUPPORTED;
+}
+
+int ctx::device_provider_base::unsubscribe()
+{
+       return ERR_NOT_SUPPORTED;
+}
+
+int ctx::device_provider_base::read()
+{
+       return ERR_NOT_SUPPORTED;
+}
+
+int ctx::device_provider_base::write()
+{
+       return ERR_NOT_SUPPORTED;
+}
+
+bool ctx::device_provider_base::get_system_info_bool(const char *key)
+{
+       bool supported = false;
+       int ret = system_info_get_platform_bool(key, &supported);
+       IF_FAIL_RETURN_TAG(ret == SYSTEM_INFO_ERROR_NONE, false, _E, "system_info_get_platform_bool() failed");
+       return supported;
+}
diff --git a/src/device/device_provider_base.h b/src/device/device_provider_base.h
new file mode 100644 (file)
index 0000000..6b2c1a9
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+#ifndef __CONTEXT_DEVICE_PROVIDER_BASE_H__
+#define __CONTEXT_DEVICE_PROVIDER_BASE_H__
+
+#include <types_internal.h>
+#include <Json.h>
+#include <ContextProviderBase.h>
+
+#define CREATE_INSTANCE(prvd) \
+       do { \
+               IF_FAIL_RETURN(!__instance, __instance); \
+               __instance = new(std::nothrow) prvd(); \
+               IF_FAIL_RETURN_TAG(__instance, NULL, _E, "Memory allocation failed"); \
+               _I(BLUE("Created")); \
+               return __instance; \
+       } while (0) \
+
+#define DESTROY_INSTANCE() \
+       do { \
+               IF_FAIL_VOID(__instance); \
+               delete __instance; \
+               __instance = NULL; \
+               _I(BLUE("Destroyed")); \
+       } while (0) \
+
+#define GENERATE_PROVIDER_COMMON_DECL(prvd) \
+       public: \
+               static ContextProviderBase *create(void *data); \
+               static void destroy(void *data); \
+       protected: \
+               void destroy_self(); \
+       private: \
+               static prvd *__instance; \
+
+#define GENERATE_PROVIDER_COMMON_IMPL(prvd) \
+       ctx::prvd *ctx::prvd::__instance = NULL; \
+       ctx::ContextProviderBase *ctx::prvd::create(void *data) \
+       { \
+               CREATE_INSTANCE(prvd); \
+       } \
+       void ctx::prvd::destroy(void *data) \
+       { \
+               DESTROY_INSTANCE(); \
+       } \
+       void ctx::prvd::destroy_self() \
+       { \
+               destroy(NULL); \
+       } \
+
+namespace ctx {
+
+       class device_provider_base : public ContextProviderBase {
+       public:
+               int subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult);
+               int unsubscribe(const char *subject, ctx::Json option);
+               int read(const char *subject, ctx::Json option, ctx::Json *requestResult);
+               int write(const char *subject, ctx::Json data, ctx::Json *requestResult);
+
+       protected:
+               bool being_subscribed;
+
+               device_provider_base();
+               virtual ~device_provider_base() {}
+
+               virtual int subscribe();
+               virtual int unsubscribe();
+               virtual int read();
+               virtual int write();
+               virtual void destroy_self() = 0;
+
+               static bool get_system_info_bool(const char *key);
+       };
+}
+
+#endif
diff --git a/src/device/provider_base.cpp b/src/device/provider_base.cpp
deleted file mode 100644 (file)
index fefe212..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * 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 <system_info.h>
-#include "provider_base.h"
-
-ctx::device_provider_base::device_provider_base()
-       : being_subscribed(false)
-{
-}
-
-int ctx::device_provider_base::subscribe(const char *subject, ctx::Json option, ctx::Json *request_result)
-{
-       IF_FAIL_RETURN(!being_subscribed, ERR_NONE);
-
-       int ret = subscribe();
-
-       if (ret == ERR_NONE)
-               being_subscribed = true;
-       else
-               destroy_self();
-
-       return ret;
-}
-
-int ctx::device_provider_base::unsubscribe(const char *subject, ctx::Json option)
-{
-       int ret = ERR_NONE;
-
-       if (being_subscribed)
-               ret = unsubscribe();
-
-       destroy_self();
-       return ret;
-}
-
-int ctx::device_provider_base::read(const char *subject, ctx::Json option, ctx::Json *request_result)
-{
-       int ret = read();
-
-       if (!being_subscribed)
-               destroy_self();
-
-       return ret;
-}
-
-int ctx::device_provider_base::write(const char *subject, ctx::Json data, ctx::Json *request_result)
-{
-       int ret = write();
-
-       if (!being_subscribed)
-               destroy_self();
-
-       return ret;
-}
-
-int ctx::device_provider_base::subscribe()
-{
-       return ERR_NOT_SUPPORTED;
-}
-
-int ctx::device_provider_base::unsubscribe()
-{
-       return ERR_NOT_SUPPORTED;
-}
-
-int ctx::device_provider_base::read()
-{
-       return ERR_NOT_SUPPORTED;
-}
-
-int ctx::device_provider_base::write()
-{
-       return ERR_NOT_SUPPORTED;
-}
-
-bool ctx::device_provider_base::get_system_info_bool(const char *key)
-{
-       bool supported = false;
-       int ret = system_info_get_platform_bool(key, &supported);
-       IF_FAIL_RETURN_TAG(ret == SYSTEM_INFO_ERROR_NONE, false, _E, "system_info_get_platform_bool() failed");
-       return supported;
-}
diff --git a/src/device/provider_base.h b/src/device/provider_base.h
deleted file mode 100644 (file)
index 39983b1..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#ifndef __CONTEXT_DEVICE_PROVIDER_BASE_H__
-#define __CONTEXT_DEVICE_PROVIDER_BASE_H__
-
-#include <types_internal.h>
-#include <Json.h>
-#include <provider_iface.h>
-
-#define CREATE_INSTANCE(prvd) \
-       do { \
-               IF_FAIL_RETURN(!__instance, __instance); \
-               __instance = new(std::nothrow) prvd(); \
-               IF_FAIL_RETURN_TAG(__instance, NULL, _E, "Memory allocation failed"); \
-               _I(BLUE("Created")); \
-               return __instance; \
-       } while (0) \
-
-#define DESTROY_INSTANCE() \
-       do { \
-               IF_FAIL_VOID(__instance); \
-               delete __instance; \
-               __instance = NULL; \
-               _I(BLUE("Destroyed")); \
-       } while (0) \
-
-#define GENERATE_PROVIDER_COMMON_DECL(prvd) \
-       public: \
-               static context_provider_iface *create(void *data); \
-               static void destroy(void *data); \
-       protected: \
-               void destroy_self(); \
-       private: \
-               static prvd *__instance; \
-
-#define GENERATE_PROVIDER_COMMON_IMPL(prvd) \
-       ctx::prvd *ctx::prvd::__instance = NULL; \
-       ctx::context_provider_iface *ctx::prvd::create(void *data) \
-       { \
-               CREATE_INSTANCE(prvd); \
-       } \
-       void ctx::prvd::destroy(void *data) \
-       { \
-               DESTROY_INSTANCE(); \
-       } \
-       void ctx::prvd::destroy_self() \
-       { \
-               destroy(NULL); \
-       } \
-
-namespace ctx {
-
-       class device_provider_base : public context_provider_iface {
-       public:
-               int subscribe(const char *subject, ctx::Json option, ctx::Json *request_result);
-               int unsubscribe(const char *subject, ctx::Json option);
-               int read(const char *subject, ctx::Json option, ctx::Json *request_result);
-               int write(const char *subject, ctx::Json data, ctx::Json *request_result);
-
-       protected:
-               bool being_subscribed;
-
-               device_provider_base();
-               virtual ~device_provider_base() {}
-
-               virtual int subscribe();
-               virtual int unsubscribe();
-               virtual int read();
-               virtual int write();
-               virtual void destroy_self() = 0;
-
-               static bool get_system_info_bool(const char *key);
-       };
-}
-
-#endif
index 745442c8a28913428e2101ccf976b34dafff625c..71e3ea840e97b83491f2c94b06f91a906e64bbe3 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <stdlib.h>
 #include <Json.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "social_types.h"
 #include "call.h"
 
@@ -57,7 +57,7 @@ bool ctx::social_status_call::is_supported()
 
 void ctx::social_status_call::submit_trigger_item()
 {
-       context_manager::register_trigger_item(SOCIAL_ST_SUBJ_CALL, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(SOCIAL_ST_SUBJ_CALL, OPS_SUBSCRIBE | OPS_READ,
                        "{"
                                "\"Medium\":{\"type\":\"string\",\"values\":[\"Voice\",\"Video\"]},"
                                "\"State\":{\"type\":\"string\",\"values\":[\"Idle\",\"Connecting\",\"Connected\"]},"
@@ -381,7 +381,7 @@ int ctx::social_status_call::read()
                release_telephony();
 
        if (ret) {
-               ctx::context_manager::reply_to_read(SOCIAL_ST_SUBJ_CALL, NULL, ERR_NONE, data);
+               ctx::context_manager::replyToRead(SOCIAL_ST_SUBJ_CALL, NULL, ERR_NONE, data);
                return ERR_NONE;
        }
 
index cdd906cbaf89d3e2591d490d6f10510b1c677e0f..f320f5cd95a5a31485830d508c5361b5ce999c73 100644 (file)
@@ -18,7 +18,7 @@
 #define _CONTEXT_SOCIAL_STATUS_CALL_H_
 
 #include <telephony.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index c7ee6e32970166f618cf2836341f8294a979764c..f071e7841b1af3c91b330f857377fa2c17e1e266 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <Json.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "social_types.h"
 #include "contacts.h"
 
@@ -42,7 +42,7 @@ bool ctx::social_status_contacts::is_supported()
 
 void ctx::social_status_contacts::submit_trigger_item()
 {
-       context_manager::register_trigger_item(SOCIAL_ST_SUBJ_CONTACTS, OPS_SUBSCRIBE,
+       context_manager::registerTriggerItem(SOCIAL_ST_SUBJ_CONTACTS, OPS_SUBSCRIBE,
                        "{"
                                "\"Event\":{\"type\":\"string\",\"values\":[\"Changed\"]},"
                                "\"Type\":{\"type\":\"string\",\"values\":[\"MyProfile\",\"Person\"]}"
index 52adb140c16ce125236e719368507c02bb611698..1169412516d38e36ab9c97b9e5b2eff265e09480 100644 (file)
@@ -18,7 +18,7 @@
 #define _CONTEXT_SOCIAL_STATUS_CONTACTS_H_
 
 #include <contacts.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index 831a9639bd8eb728acd6d4710e98d73393be065e..898cf03fdb188d5976ba72008da5d855165388a9 100644 (file)
@@ -17,7 +17,7 @@
 #include <gio/gio.h>
 #include <email-api-etc.h>
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "social_types.h"
 #include "email.h"
 
@@ -40,7 +40,7 @@ bool ctx::social_status_email::is_supported()
 
 void ctx::social_status_email::submit_trigger_item()
 {
-       context_manager::register_trigger_item(SOCIAL_ST_SUBJ_EMAIL, OPS_SUBSCRIBE,
+       context_manager::registerTriggerItem(SOCIAL_ST_SUBJ_EMAIL, OPS_SUBSCRIBE,
                        "{"
                                "\"Event\":{\"type\":\"string\",\"values\":[\"Received\",\"Sent\"]}"
                        "}",
@@ -60,15 +60,15 @@ void ctx::social_status_email::onSignal(const char* sender, const char* path, co
        if (sub_type == NOTI_DOWNLOAD_FINISH) {
                //TODO: Check if this signal actually means that there are new mails
                _D("sub type: %d, gi1: %d, gc: %s, gi2: %d, gi3: %d", sub_type, gi1, gc, gi2, gi3);
-               ctx::Json data_updated;
-               data_updated.set(NULL, SOCIAL_ST_EVENT, SOCIAL_ST_RECEIVED);
-               context_manager::publish(SOCIAL_ST_SUBJ_EMAIL, NULL, ERR_NONE, data_updated);
+               ctx::Json dataUpdated;
+               dataUpdated.set(NULL, SOCIAL_ST_EVENT, SOCIAL_ST_RECEIVED);
+               context_manager::publish(SOCIAL_ST_SUBJ_EMAIL, NULL, ERR_NONE, dataUpdated);
 
        } else if (sub_type == NOTI_SEND_FINISH) {
                _D("sub type: %d, gi1: %d, gc: %s, gi2: %d, gi3: %d", sub_type, gi1, gc, gi2, gi3);
-               ctx::Json data_updated;
-               data_updated.set(NULL, SOCIAL_ST_EVENT, SOCIAL_ST_SENT);
-               context_manager::publish(SOCIAL_ST_SUBJ_EMAIL, NULL, ERR_NONE, data_updated);
+               ctx::Json dataUpdated;
+               dataUpdated.set(NULL, SOCIAL_ST_EVENT, SOCIAL_ST_SENT);
+               context_manager::publish(SOCIAL_ST_SUBJ_EMAIL, NULL, ERR_NONE, dataUpdated);
        }
 }
 
index 930da245de566d09bef2b8bcd894a59eb22c6ffb..9cc75080cb934ac46d07922e9620331ab0bed109 100644 (file)
@@ -18,7 +18,7 @@
 #define _CONTEXT_SOCIAL_STATUS_EMAIL_H_
 
 #include <DBusSignalWatcher.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index 4d46fe96f796aef3f76e7c64853cc8f5c2bdc3c3..cf75e4f97cf6a37e9a5895ccf216d65eb7a9ae1f 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <Json.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "social_types.h"
 #include "message.h"
 
@@ -39,7 +39,7 @@ bool ctx::social_status_message::is_supported()
 
 void ctx::social_status_message::submit_trigger_item()
 {
-       context_manager::register_trigger_item(SOCIAL_ST_SUBJ_MESSAGE, OPS_SUBSCRIBE,
+       context_manager::registerTriggerItem(SOCIAL_ST_SUBJ_MESSAGE, OPS_SUBSCRIBE,
                        "{"
                                "\"Event\":{\"type\":\"string\",\"values\":[\"Received\"]},"
                                "\"Type\":{\"type\":\"string\",\"values\":[\"SMS\",\"MMS\"]},"
index 1c1d15b485fcb2fb652a3e2baeec6a05d48244b2..5239f21ada267f3cd984c54eab811cd7cf6761d3 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <msg.h>
 #include <msg_transport.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index d1c6f2628e9fa4f4a4bd712e38822eb5dccd4705..d4434a9c04ad730288b2f04d0eeb997218ae8bf9 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "system_types.h"
 #include "alarm.h"
 
@@ -41,7 +41,7 @@ bool ctx::device_status_alarm::is_supported()
 
 void ctx::device_status_alarm::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_ALARM, OPS_SUBSCRIBE,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_ALARM, OPS_SUBSCRIBE,
                        "{"
                                "\"TimeOfDay\":{\"type\":\"integer\",\"min\":0,\"max\":1439},"
                                "\"DayOfWeek\":{\"type\":\"string\",\"values\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\",\"Weekday\",\"Weekend\"]}"
@@ -49,7 +49,7 @@ void ctx::device_status_alarm::submit_trigger_item()
                        NULL);
 }
 
-int ctx::device_status_alarm::subscribe(const char *subject, ctx::Json option, ctx::Json *request_result)
+int ctx::device_status_alarm::subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult)
 {
        int ret = subscribe(option);
        destroy_if_unused();
@@ -63,13 +63,13 @@ int ctx::device_status_alarm::unsubscribe(const char *subject, ctx::Json option)
        return ret;
 }
 
-int ctx::device_status_alarm::read(const char *subject, ctx::Json option, ctx::Json *request_result)
+int ctx::device_status_alarm::read(const char *subject, ctx::Json option, ctx::Json *requestResult)
 {
        destroy_if_unused();
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::device_status_alarm::write(const char *subject, ctx::Json data, ctx::Json *request_result)
+int ctx::device_status_alarm::write(const char *subject, ctx::Json data, ctx::Json *requestResult)
 {
        destroy_if_unused();
        return ERR_NOT_SUPPORTED;
@@ -250,16 +250,16 @@ void ctx::device_status_alarm::on_timer_expired(int hour, int min, int day_of_we
 {
        _I("Time: %02d:%02d, Day of Week: %#x", hour, min, day_of_week);
 
-       ctx::Json data_read;
+       ctx::Json dataRead;
        int result_time = hour * 60 + min;
        std::string result_day = ctx::TimerManager::dowToStr(day_of_week);
-       data_read.set(NULL, DEVICE_ST_TIME_OF_DAY, result_time);
-       data_read.set(NULL, DEVICE_ST_DAY_OF_WEEK, result_day);
+       dataRead.set(NULL, DEVICE_ST_TIME_OF_DAY, result_time);
+       dataRead.set(NULL, DEVICE_ST_DAY_OF_WEEK, result_day);
 
        for (option_t::iterator it = option_set.begin(); it != option_set.end(); ++it) {
                ctx::Json option = (**it);
                if (is_matched(option, result_time, result_day)) {
-                       context_manager::publish(DEVICE_ST_SUBJ_ALARM, option, ERR_NONE, data_read);
+                       context_manager::publish(DEVICE_ST_SUBJ_ALARM, option, ERR_NONE, dataRead);
                }
        }
 }
index 8d640e306663e50197caf8ce60fda4568f121ecf..ff5271b139c58b2c2336e3ca0713a1ba3b5de29f 100644 (file)
 
 #include <map>
 #include <set>
-#include <provider_iface.h>
+#include <ContextProviderBase.h>
 #include <TimerManager.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
-       class device_status_alarm : public context_provider_iface, ITimerListener {
+       class device_status_alarm : public ContextProviderBase, ITimerListener {
 
                GENERATE_PROVIDER_COMMON_DECL(device_status_alarm);
 
        public:
-               int subscribe(const char *subject, ctx::Json option, ctx::Json *request_result);
+               int subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult);
                int unsubscribe(const char *subject, ctx::Json option);
-               int read(const char *subject, ctx::Json option, ctx::Json *request_result);
-               int write(const char *subject, ctx::Json data, ctx::Json *request_result);
+               int read(const char *subject, ctx::Json option, ctx::Json *requestResult);
+               int write(const char *subject, ctx::Json data, ctx::Json *requestResult);
 
                int subscribe(ctx::Json option);
                int unsubscribe(ctx::Json option);
index 5be24b688df783c96548ae499d2feb22eebad1ab..6207db9cdca642cda89e3f4cc974a7536a85cf39 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "system_types.h"
 #include "battery.h"
 
@@ -35,7 +35,7 @@ bool ctx::device_status_battery::is_supported()
 
 void ctx::device_status_battery::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_BATTERY, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_BATTERY, OPS_SUBSCRIBE | OPS_READ,
                        "{"
                                "\"Level\":{\"type\":\"string\",\"values\":[\"Empty\",\"Critical\",\"Low\",\"Normal\",\"High\",\"Full\"]},"
                                TRIG_BOOL_ITEM_DEF("IsCharging")
@@ -58,15 +58,15 @@ void ctx::device_status_battery::handle_update(device_callback_e device_type, vo
        const char* level_string = trans_to_string(level);
        IF_FAIL_VOID(level_string);
 
-       ctx::Json data_read;
-       data_read.set(NULL, DEVICE_ST_LEVEL, level_string);
+       ctx::Json dataRead;
+       dataRead.set(NULL, DEVICE_ST_LEVEL, level_string);
 
        bool charging_state = false;
        int ret = device_battery_is_charging(&charging_state);
        IF_FAIL_VOID_TAG(ret == DEVICE_ERROR_NONE, _E, "Getting state failed");
 
-       data_read.set(NULL, DEVICE_ST_IS_CHARGING, charging_state ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
-       ctx::context_manager::publish(DEVICE_ST_SUBJ_BATTERY, NULL, ERR_NONE, data_read);
+       dataRead.set(NULL, DEVICE_ST_IS_CHARGING, charging_state ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
+       ctx::context_manager::publish(DEVICE_ST_SUBJ_BATTERY, NULL, ERR_NONE, dataRead);
 }
 
 const char* ctx::device_status_battery::trans_to_string(intptr_t level)
@@ -120,7 +120,7 @@ int ctx::device_status_battery::unsubscribe()
 int ctx::device_status_battery::read()
 {
        device_battery_level_e level;
-       ctx::Json data_read;
+       ctx::Json dataRead;
 
        int ret = device_battery_get_level_status(&level);
        IF_FAIL_RETURN(ret == DEVICE_ERROR_NONE, ERR_OPERATION_FAILED);
@@ -128,14 +128,14 @@ int ctx::device_status_battery::read()
        const char* level_string = trans_to_string(level);
        IF_FAIL_RETURN(level_string, ERR_OPERATION_FAILED);
 
-       data_read.set(NULL, DEVICE_ST_LEVEL, level_string);
+       dataRead.set(NULL, DEVICE_ST_LEVEL, level_string);
 
        bool charging_state = false;
        ret = device_battery_is_charging(&charging_state);
        IF_FAIL_RETURN(ret == DEVICE_ERROR_NONE, ERR_OPERATION_FAILED);
 
-       data_read.set(NULL, DEVICE_ST_IS_CHARGING, charging_state ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
+       dataRead.set(NULL, DEVICE_ST_IS_CHARGING, charging_state ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
 
-       ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_BATTERY, NULL, ERR_NONE, data_read);
+       ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_BATTERY, NULL, ERR_NONE, dataRead);
        return ERR_NONE;
 }
index 6fc3fdf3e06149d4016a23ecd3f8da7048eeebe6..8f8a723ea79050e91803100f213c1c83209d0844 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <device/callback.h>
 #include <device/battery.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index ac3d5db631ee02efc25a5a33901b3dbff747f981..91e1708e66456a9730dd5b1ebf03c2d13a2b60ce 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "system_types.h"
 #include "headphone.h"
 
@@ -44,7 +44,7 @@ bool ctx::device_status_headphone::is_supported()
 
 void ctx::device_status_headphone::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_HEADPHONE, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_HEADPHONE, OPS_SUBSCRIBE | OPS_READ,
                        "{"
                                TRIG_BOOL_ITEM_DEF("IsConnected") ","
                                "\"Type\":{\"type\":\"string\",\"values\":[\"Normal\",\"Headset\",\"Bluetooth\"]}"
@@ -81,7 +81,7 @@ int ctx::device_status_headphone::read()
 
        Json data;
        generate_data_packet(data);
-       ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_HEADPHONE, NULL, ERR_NONE, data);
+       ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_HEADPHONE, NULL, ERR_NONE, data);
 
        return ERR_NONE;
 }
index f451d52779452bbd0735dcab2f3185c150ce93d5..8922a61660a6e9a81ee9518c55f0ce1fd0cde15b 100644 (file)
@@ -20,7 +20,7 @@
 #include <glib.h>
 #include <runtime_info.h>
 #include <bluetooth.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index dcfc3595c9611e417975df0b2a00379bd2b85816..dc39f98f4561b84551ec481e970b2a095d99f6f4 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "system_types.h"
 #include "psmode.h"
 
@@ -35,7 +35,7 @@ bool ctx::device_status_psmode::is_supported()
 
 void ctx::device_status_psmode::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_PSMODE, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_PSMODE, OPS_SUBSCRIBE | OPS_READ,
                        "{" TRIG_BOOL_ITEM_DEF("IsEnabled") "}", NULL);
 }
 
@@ -48,14 +48,14 @@ void ctx::device_status_psmode::update_cb(keynode_t *node, void* user_data)
 void ctx::device_status_psmode::handle_update(keynode_t *node)
 {
        int status;
-       ctx::Json data_read;
+       ctx::Json dataRead;
 
        status = vconf_keynode_get_int(node);
        IF_FAIL_VOID_TAG(status >= 0, _E, "Getting state failed");
 
-       data_read.set(NULL, DEVICE_ST_IS_ENABLED, status == 0 ? DEVICE_ST_FALSE : DEVICE_ST_TRUE);
+       dataRead.set(NULL, DEVICE_ST_IS_ENABLED, status == 0 ? DEVICE_ST_FALSE : DEVICE_ST_TRUE);
 
-       context_manager::publish(DEVICE_ST_SUBJ_PSMODE, NULL, ERR_NONE, data_read);
+       context_manager::publish(DEVICE_ST_SUBJ_PSMODE, NULL, ERR_NONE, dataRead);
 }
 
 int ctx::device_status_psmode::subscribe()
@@ -78,9 +78,9 @@ int ctx::device_status_psmode::read()
        int ret = vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &mode);
        IF_FAIL_RETURN(ret == VCONF_OK, ERR_OPERATION_FAILED);
 
-       ctx::Json data_read;
-       data_read.set(NULL, DEVICE_ST_IS_ENABLED, mode == 0 ? DEVICE_ST_FALSE : DEVICE_ST_TRUE);
+       ctx::Json dataRead;
+       dataRead.set(NULL, DEVICE_ST_IS_ENABLED, mode == 0 ? DEVICE_ST_FALSE : DEVICE_ST_TRUE);
 
-       ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_PSMODE, NULL, ERR_NONE, data_read);
+       ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_PSMODE, NULL, ERR_NONE, dataRead);
        return ERR_NONE;
 }
index 2cc16603e56afd9fe69d5801493bcf9186105140..1d4e4f316a0a2c9f9060afc8c2055cbe413fb557 100644 (file)
@@ -18,7 +18,7 @@
 #define _DEVICE_STATUS_POWER_SAVING_MODE_H_
 
 #include <vconf.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index 29480c5451823e12669268fec93897de4992b4b8..faaaa6a2597ddf3b2c0c43a53a94f15364946484 100644 (file)
@@ -18,7 +18,7 @@
 #define __CONTEXT_DEVICE_STATUS_RUNTIME_INFO_H__
 
 #include <runtime_info.h>
-#include "../../provider_base.h"
+#include "../../device_provider_base.h"
 
 namespace ctx {
 
index ae16d8cddcab138b0f337b2f94910e2a0a6e9a11..d4cec25c90b442a39b1c63ae8c4fe6003f1a9ed3 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "../system_types.h"
 #include "charger.h"
 
@@ -36,7 +36,7 @@ bool ctx::device_status_charger::is_supported()
 
 void ctx::device_status_charger::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_CHARGER, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_CHARGER, OPS_SUBSCRIBE | OPS_READ,
                        "{" TRIG_BOOL_ITEM_DEF("IsConnected") "}", NULL);
 }
 
@@ -47,22 +47,22 @@ void ctx::device_status_charger::handle_update()
        int ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_CHARGER_CONNECTED, &charger_status);
        IF_FAIL_VOID_TAG(ret == RUNTIME_INFO_ERROR_NONE, _E, "Getting runtime info failed");
 
-       ctx::Json data_read;
-       data_read.set(NULL, DEVICE_ST_IS_CONNECTED, charger_status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
+       ctx::Json dataRead;
+       dataRead.set(NULL, DEVICE_ST_IS_CONNECTED, charger_status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
 
-       context_manager::publish(DEVICE_ST_SUBJ_CHARGER, NULL, ERR_NONE, data_read);
+       context_manager::publish(DEVICE_ST_SUBJ_CHARGER, NULL, ERR_NONE, dataRead);
 }
 
 int ctx::device_status_charger::read()
 {
        bool charger_status = false;
-       ctx::Json data_read;
+       ctx::Json dataRead;
 
        int ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_CHARGER_CONNECTED, &charger_status);
        IF_FAIL_RETURN_TAG(ret == RUNTIME_INFO_ERROR_NONE, ERR_OPERATION_FAILED, _E, "Getting runtime info failed");
 
-       data_read.set(NULL, DEVICE_ST_IS_CONNECTED, charger_status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
+       dataRead.set(NULL, DEVICE_ST_IS_CONNECTED, charger_status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
 
-       ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_CHARGER, NULL, ERR_NONE, data_read);
+       ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_CHARGER, NULL, ERR_NONE, dataRead);
        return ERR_NONE;
 }
index 80aa16c4c36ebb4b7386144716877e28b2bc1263..9624d381dbd277fbcd7caf191dd455b43fe92adb 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "../system_types.h"
 #include "gps.h"
 
@@ -54,7 +54,7 @@ bool ctx::device_status_gps::is_supported()
 
 void ctx::device_status_gps::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_GPS, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_GPS, OPS_SUBSCRIBE | OPS_READ,
                        "{"
                                "\"State\":{\"type\":\"string\",\"values\":[\"Disabled\",\"Searching\",\"Connected\"]}"
                        "}",
@@ -67,20 +67,20 @@ void ctx::device_status_gps::handle_update()
        int ret = runtime_info_get_value_int(RUNTIME_INFO_KEY_GPS_STATUS, &gps_status);
        IF_FAIL_VOID_TAG(ret == RUNTIME_INFO_ERROR_NONE, _E, "Getting runtime info failed");
 
-       ctx::Json data_read;
+       ctx::Json dataRead;
 
        const char* state_str = get_state_string(gps_status);
        IF_FAIL_VOID(state_str);
 
-       data_read.set(NULL, DEVICE_ST_STATE, state_str);
+       dataRead.set(NULL, DEVICE_ST_STATE, state_str);
 
-       context_manager::publish(DEVICE_ST_SUBJ_GPS, NULL, ERR_NONE, data_read);
+       context_manager::publish(DEVICE_ST_SUBJ_GPS, NULL, ERR_NONE, dataRead);
 }
 
 int ctx::device_status_gps::read()
 {
        int gps_status;
-       ctx::Json data_read;
+       ctx::Json dataRead;
 
        int ret = runtime_info_get_value_int(RUNTIME_INFO_KEY_GPS_STATUS, &gps_status);
        IF_FAIL_RETURN_TAG(ret == RUNTIME_INFO_ERROR_NONE, ERR_OPERATION_FAILED, _E, "Getting runtime info failed");
@@ -88,8 +88,8 @@ int ctx::device_status_gps::read()
        const char* state_str = get_state_string(gps_status);
        IF_FAIL_RETURN(state_str, ERR_OPERATION_FAILED);
 
-       data_read.set(NULL, DEVICE_ST_STATE, state_str);
+       dataRead.set(NULL, DEVICE_ST_STATE, state_str);
 
-       ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_GPS, NULL, ERR_NONE, data_read);
+       ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_GPS, NULL, ERR_NONE, dataRead);
        return ERR_NONE;
 }
index 0ab4d0d70903c05bcec19b09ccf7e9632b92a2be..2b7ddbc12d8ecd8b6a3845028418abba619f7996 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "../system_types.h"
 #include "usb.h"
 
@@ -36,7 +36,7 @@ bool ctx::device_status_usb::is_supported()
 
 void ctx::device_status_usb::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_USB, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_USB, OPS_SUBSCRIBE | OPS_READ,
                        "{" TRIG_BOOL_ITEM_DEF("IsConnected") "}", NULL);
 }
 
@@ -47,22 +47,22 @@ void ctx::device_status_usb::handle_update()
        int ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_USB_CONNECTED, &status);
        IF_FAIL_VOID_TAG(ret == RUNTIME_INFO_ERROR_NONE, _E, "Getting runtime info failed");
 
-       ctx::Json data_read;
-       data_read.set(NULL, DEVICE_ST_IS_CONNECTED, status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
+       ctx::Json dataRead;
+       dataRead.set(NULL, DEVICE_ST_IS_CONNECTED, status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
 
-       context_manager::publish(DEVICE_ST_SUBJ_USB, NULL, ERR_NONE, data_read);
+       context_manager::publish(DEVICE_ST_SUBJ_USB, NULL, ERR_NONE, dataRead);
 }
 
 int ctx::device_status_usb::read()
 {
        bool status = false;
-       ctx::Json data_read;
+       ctx::Json dataRead;
 
        int ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_USB_CONNECTED, &status);
        IF_FAIL_RETURN_TAG(ret == RUNTIME_INFO_ERROR_NONE, ERR_OPERATION_FAILED, _E, "Getting runtime info failed");
 
-       data_read.set(NULL, DEVICE_ST_IS_CONNECTED, status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
+       dataRead.set(NULL, DEVICE_ST_IS_CONNECTED, status ? DEVICE_ST_TRUE : DEVICE_ST_FALSE);
 
-       ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_USB, NULL, ERR_NONE, data_read);
+       ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_USB, NULL, ERR_NONE, dataRead);
        return ERR_NONE;
 }
index 7f5515af54fee36f54573211adc4d16229603e4a..6cd5ea04385782df74345a1cb544cdd06ada0549 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include <TimerManager.h>
 #include "system_types.h"
 #include "time.h"
@@ -36,7 +36,7 @@ bool ctx::device_status_time::is_supported()
 
 void ctx::device_status_time::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_TIME, OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_TIME, OPS_READ,
                        "{"
                                "\"TimeOfDay\":{\"type\":\"integer\",\"min\":0,\"max\":1439},"
                                "\"DayOfWeek\":{\"type\":\"string\",\"values\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\",\"Weekday\",\"Weekend\"]},"
@@ -68,14 +68,14 @@ int ctx::device_status_time::read()
        int minute_of_day = timeinfo.tm_hour * 60 + timeinfo.tm_min;
        std::string day_of_week = ctx::TimerManager::dowToStr(0x01 << timeinfo.tm_wday);
 
-       ctx::Json data_read;
-       data_read.set(NULL, DEVICE_ST_DAY_OF_MONTH, day_of_month);
-       data_read.set(NULL, DEVICE_ST_DAY_OF_WEEK, day_of_week);
-       data_read.set(NULL, DEVICE_ST_TIME_OF_DAY, minute_of_day);
+       ctx::Json dataRead;
+       dataRead.set(NULL, DEVICE_ST_DAY_OF_MONTH, day_of_month);
+       dataRead.set(NULL, DEVICE_ST_DAY_OF_WEEK, day_of_week);
+       dataRead.set(NULL, DEVICE_ST_TIME_OF_DAY, minute_of_day);
 
        _I("Time: %02d:%02d, Day of Week: %s, Day of Month: %d", timeinfo.tm_hour, timeinfo.tm_min, day_of_week.c_str(), day_of_month);
 
-       ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_TIME, NULL, ERR_NONE, data_read);
+       ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_TIME, NULL, ERR_NONE, dataRead);
 
        return ERR_NONE;
 }
index 6775d7a08cd891306864168e82921f01826e5005..7d44becf42af95107ce78b84df5bb8fd09851046 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef _DEVICE_STATUS_TIME_H_
 #define _DEVICE_STATUS_TIME_H_
 
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index a40c179ad01798da323030daa4b8513ddb46c0d7..4d237df698713b9292c1fc639c75699f496e6421 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <SharedVars.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "system_types.h"
 #include "wifi.h"
 
@@ -39,7 +39,7 @@ ctx::device_status_wifi::~device_status_wifi()
 {
 }
 
-ctx::context_provider_iface *ctx::device_status_wifi::create(void *data)
+ctx::ContextProviderBase *ctx::device_status_wifi::create(void *data)
 {
        CREATE_INSTANCE(device_status_wifi);
 }
@@ -62,7 +62,7 @@ bool ctx::device_status_wifi::is_supported()
 
 void ctx::device_status_wifi::submit_trigger_item()
 {
-       context_manager::register_trigger_item(DEVICE_ST_SUBJ_WIFI, OPS_SUBSCRIBE | OPS_READ,
+       context_manager::registerTriggerItem(DEVICE_ST_SUBJ_WIFI, OPS_SUBSCRIBE | OPS_READ,
                        "{"
                                "\"State\":{\"type\":\"string\",\"values\":[\"Disabled\",\"Unconnected\",\"Connected\"]},"
                                "\"BSSID\":{\"type\":\"string\"}"
@@ -162,10 +162,10 @@ int ctx::device_status_wifi::read()
 {
        IF_FAIL_RETURN(get_current_state(), ERR_OPERATION_FAILED);
 
-       ctx::Json data_read;
+       ctx::Json dataRead;
 
-       if (get_response_packet(data_read)) {
-               ctx::context_manager::reply_to_read(DEVICE_ST_SUBJ_WIFI, NULL, ERR_NONE, data_read);
+       if (get_response_packet(dataRead)) {
+               ctx::context_manager::replyToRead(DEVICE_ST_SUBJ_WIFI, NULL, ERR_NONE, dataRead);
                return ERR_NONE;
        }
 
index 6bd81c10ec405e7283f0a8a99d5ddbb2dae7ac37..3ed52d542c8fa7b5a5073a55fc55562fdba9830a 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <string>
 #include <wifi.h>
-#include "../provider_base.h"
+#include "../device_provider_base.h"
 
 namespace ctx {
 
index 8ea7684facd4540cba88fee9ea6d8f0b3c3cec05..d7b8fcc4a9d440bf1c6784c88c3716075fb8825e 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <types_internal.h>
 #include <Json.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "place_geofence_types.h"
 #include "myplace_handle.h"
 
index c1525a1a52ca4b47a877488e04ed0c5147c97d5f..5bcfb7fffff0449a810e56eadc070d23555d8f11 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <types_internal.h>
 #include <Json.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "place_geofence.h"
 
 ctx::place_geofence_provider *ctx::place_geofence_provider::__instance = NULL;
@@ -36,7 +36,7 @@ ctx::place_geofence_provider::~place_geofence_provider()
        __handle_map.clear();
 }
 
-ctx::context_provider_iface *ctx::place_geofence_provider::create(void *data)
+ctx::ContextProviderBase *ctx::place_geofence_provider::create(void *data)
 {
        IF_FAIL_RETURN(!__instance, __instance);
        __instance = new(std::nothrow) place_geofence_provider();
@@ -63,7 +63,7 @@ bool ctx::place_geofence_provider::is_supported()
 
 void ctx::place_geofence_provider::submit_trigger_item()
 {
-       context_manager::register_trigger_item(PLACE_SUBJ_GEOFENCE, OPS_SUBSCRIBE,
+       context_manager::registerTriggerItem(PLACE_SUBJ_GEOFENCE, OPS_SUBSCRIBE,
                        "{"
                                "\"Event\":{\"type\":\"string\",\"values\":[\"In\",\"Out\"]}"
                        "}",
@@ -79,7 +79,7 @@ void ctx::place_geofence_provider::__destroy_if_unused()
 }
 
 
-int ctx::place_geofence_provider::subscribe(const char *subject, ctx::Json option, ctx::Json *request_result)
+int ctx::place_geofence_provider::subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult)
 {
        int ret = __subscribe(option);
        __destroy_if_unused();
@@ -93,13 +93,13 @@ int ctx::place_geofence_provider::unsubscribe(const char *subject, ctx::Json opt
        return ret;
 }
 
-int ctx::place_geofence_provider::read(const char *subject, ctx::Json option, ctx::Json *request_result)
+int ctx::place_geofence_provider::read(const char *subject, ctx::Json option, ctx::Json *requestResult)
 {
        __destroy_if_unused();
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::place_geofence_provider::write(const char *subject, ctx::Json data, ctx::Json *request_result)
+int ctx::place_geofence_provider::write(const char *subject, ctx::Json data, ctx::Json *requestResult)
 {
        __destroy_if_unused();
        return ERR_NOT_SUPPORTED;
index 05de0079f8c3aee9bef49a92e8e19017e363b7c1..739610f1f3cb410804bff6c07d30095fb4adde3f 100644 (file)
 #define __CONTEXT_PLACE_GEOFENCE_H__
 
 #include <map>
-#include <provider_iface.h>
+#include <ContextProviderBase.h>
 #include "myplace_handle.h"
 #include "place_geofence_types.h"
 
 namespace ctx {
 
-       class place_geofence_provider : public context_provider_iface {
+       class place_geofence_provider : public ContextProviderBase {
                typedef std::map<int, ctx::myplace_handle*> handle_map_t;
 
        public:
-               static context_provider_iface *create(void *data);
+               static ContextProviderBase *create(void *data);
                static void destroy(void *data);
                static bool is_supported();
                static void submit_trigger_item();
 
-               int subscribe(const char *subject, ctx::Json option, ctx::Json *request_result);
+               int subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult);
                int unsubscribe(const char *subject, ctx::Json option);
-               int read(const char *subject, ctx::Json option, ctx::Json *request_result);
-               int write(const char *subject, ctx::Json data, ctx::Json *request_result);
+               int read(const char *subject, ctx::Json option, ctx::Json *requestResult);
+               int write(const char *subject, ctx::Json data, ctx::Json *requestResult);
 
        private:
                static place_geofence_provider *__instance;
index 934f7807a6c4d05d7444bb8227e3bf74cca60dc4..6bcf1c395903e37a7a59e1e296256ccd76be3d2f 100644 (file)
@@ -15,8 +15,8 @@
  */
 
 #include <types_internal.h>
-#include <context_mgr.h>
-#include <provider_iface.h>
+#include <ContextManager.h>
+#include <ContextProviderBase.h>
 #include <place_context_provider.h>
 
 #ifdef _MOBILE_
 #endif /* _MOBILE_ */
 
 template<typename provider>
-void register_provider(const char *subject, const char *privilege)
+void registerProvider(const char *subject, const char *privilege)
 {
        if (!provider::is_supported())
                return;
 
-       ctx::context_provider_info provider_info(provider::create, provider::destroy, NULL, privilege);
-       ctx::context_manager::register_provider(subject, provider_info);
+       ctx::ContextProviderInfo providerInfo(provider::create, provider::destroy, NULL, privilege);
+       ctx::context_manager::registerProvider(subject, providerInfo);
 }
 
 EXTAPI bool ctx::init_place_context_provider()
 {
 #ifdef _MOBILE_
-       register_provider<place_geofence_provider>(PLACE_SUBJ_GEOFENCE, PLACE_PRIV_GEOFENCE);
+       registerProvider<place_geofence_provider>(PLACE_SUBJ_GEOFENCE, PLACE_PRIV_GEOFENCE);
        place_geofence_provider::submit_trigger_item();
 
 #ifndef _DISABLE_RECOG_ENGINE_
        place_recognition_provider::create(NULL);
-       register_provider<place_recognition_provider>(PLACE_SUBJ_RECOGNITION, PLACE_PRIV_RECOGNITION);
+       registerProvider<place_recognition_provider>(PLACE_SUBJ_RECOGNITION, PLACE_PRIV_RECOGNITION);
 #endif /* _DISABLE_RECOG_ENGINE_ */
 
 #endif /* _MOBILE_ */
index 9cdd6f690e56b4f45c51cb6b0a487e7e20edafc9..0b1b7900dd27c29f4ea8be23c4978e1422d6731a 100644 (file)
  */
 
 #include <types_internal.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "place_recognition.h"
 #include "user_places/user_places.h"
 
 ctx::place_recognition_provider *ctx::place_recognition_provider::__instance = NULL;
 
-ctx::context_provider_iface *ctx::place_recognition_provider::create(void *data)
+ctx::ContextProviderBase *ctx::place_recognition_provider::create(void *data)
 {
        IF_FAIL_RETURN(!__instance, __instance);
        __instance = new(std::nothrow) place_recognition_provider();
@@ -38,7 +38,7 @@ void ctx::place_recognition_provider::destroy(void *data)
        _I(BLUE("Destroyed"));
 }
 
-int ctx::place_recognition_provider::subscribe(const char *subject, ctx::Json option, ctx::Json* request_result)
+int ctx::place_recognition_provider::subscribe(const char *subject, ctx::Json option, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
@@ -48,25 +48,25 @@ int ctx::place_recognition_provider::unsubscribe(const char *subject, ctx::Json
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::place_recognition_provider::read(const char *subject, ctx::Json option, ctx::Json* request_result)
+int ctx::place_recognition_provider::read(const char *subject, ctx::Json option, ctx::Json* requestResult)
 {
        _I(BLUE("Read"));
        _J("Option", option);
 
        std::vector<std::shared_ptr<ctx::Place>> places = engine.get_places();
-       Json data_read = UserPlaces::compose_json(places);
+       Json dataRead = UserPlaces::compose_json(places);
 
        // The below function needs to be called once.
        // It does not need to be called within this read() function.
        // In can be called later, in another scope.
        // Please just be sure that, the 2nd input parameter "option" should be the same to the
        // "option" parameter received via ctx::place_recognition_provider::read().
-       ctx::context_manager::reply_to_read(PLACE_SUBJ_RECOGNITION, option, ERR_NONE, data_read);
+       ctx::context_manager::replyToRead(PLACE_SUBJ_RECOGNITION, option, ERR_NONE, dataRead);
 
        return ERR_NONE;
 }
 
-int ctx::place_recognition_provider::write(const char *subject, ctx::Json data, ctx::Json* request_result)
+int ctx::place_recognition_provider::write(const char *subject, ctx::Json data, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
index 8f254248095e49c34d73107fc591cfaa69397d44..40a93ec5e16ff3b834255d2793a380584d2a74c7 100644 (file)
 #ifndef __CONTEXT_PLACE_RECOGNITION_H__
 #define __CONTEXT_PLACE_RECOGNITION_H__
 
-#include <provider_iface.h>
+#include <ContextProviderBase.h>
 #include "place_recognition_types.h"
 #include "user_places/user_places.h"
 
 namespace ctx {
 
-       class place_recognition_provider : public context_provider_iface {
+       class place_recognition_provider : public ContextProviderBase {
 
        public:
-               static context_provider_iface *create(void *data);
+               static ContextProviderBase *create(void *data);
                static void destroy(void *data);
                static bool is_supported();
 
-               int subscribe(const char *subject, ctx::Json option, ctx::Json *request_result);
+               int subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult);
                int unsubscribe(const char *subject, ctx::Json option);
-               int read(const char *subject, ctx::Json option, ctx::Json *request_result);
-               int write(const char *subject, ctx::Json data, ctx::Json *request_result);
+               int read(const char *subject, ctx::Json option, ctx::Json *requestResult);
+               int write(const char *subject, ctx::Json data, ctx::Json *requestResult);
 
        private:
                static place_recognition_provider *__instance;
index cdb53f4ec097657255026b375ff2a2bcec30f1c0..d924034aaf76a8b5b39a5639714f5c4d1f2a8b68 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <types_internal.h>
 #include <Json.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "app_stats_provider.h"
 #include "db_handle.h"
 
@@ -41,7 +41,7 @@ ctx::app_statistics_provider::~app_statistics_provider()
        launch_mon = NULL;
 }
 
-ctx::context_provider_iface *ctx::app_statistics_provider::create(void *data)
+ctx::ContextProviderBase *ctx::app_statistics_provider::create(void *data)
 {
        IF_FAIL_RETURN(!__instance, __instance);
 
@@ -72,7 +72,7 @@ bool ctx::app_statistics_provider::is_supported(const char* subject)
 
 void ctx::app_statistics_provider::submit_trigger_item()
 {
-       context_manager::register_trigger_item(APP_SUBJ_FREQUENCY, OPS_READ,
+       context_manager::registerTriggerItem(APP_SUBJ_FREQUENCY, OPS_READ,
                        "{" TRIG_DEF_RANK "," TRIG_DEF_TOTAL_COUNT "}",
                        "{"
                                "\"AppId\":{\"type\":\"string\"},"
@@ -98,7 +98,7 @@ CATCH:
        return false;
 }
 
-int ctx::app_statistics_provider::subscribe(const char* subject, ctx::Json option, ctx::Json* request_result)
+int ctx::app_statistics_provider::subscribe(const char* subject, ctx::Json option, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
@@ -108,7 +108,7 @@ int ctx::app_statistics_provider::unsubscribe(const char* subject, ctx::Json opt
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::app_statistics_provider::read(const char* subject, ctx::Json option, ctx::Json* request_result)
+int ctx::app_statistics_provider::read(const char* subject, ctx::Json option, ctx::Json* requestResult)
 {
        ctx::app_db_handle *handle = new(std::nothrow) ctx::app_db_handle();
        IF_FAIL_RETURN_TAG(handle, ERR_OPERATION_FAILED, _E, "Memory allocation failed");
@@ -122,7 +122,7 @@ int ctx::app_statistics_provider::read(const char* subject, ctx::Json option, ct
        return ERR_NONE;
 }
 
-int ctx::app_statistics_provider::write(const char* subject, ctx::Json data, ctx::Json* request_result)
+int ctx::app_statistics_provider::write(const char* subject, ctx::Json data, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
index 7735fd253e5a31e598141344d059546c920e19ef..b224d77945d47a33026a2a980a4418f0da412f8e 100644 (file)
 #ifndef __CONTEXT_APP_STATS_PROVIDER_H__
 #define __CONTEXT_APP_STATS_PROVIDER_H__
 
-#include <provider_iface.h>
+#include <ContextProviderBase.h>
 #include "app_stats_types.h"
 
 namespace ctx {
 
-       class app_statistics_provider : public context_provider_iface {
+       class app_statistics_provider : public ContextProviderBase {
        public:
-               static context_provider_iface *create(void *data);
+               static ContextProviderBase *create(void *data);
                static void destroy(void *data);
                static bool is_supported(const char *subject);
                static void submit_trigger_item();
 
-               int subscribe(const char *subject, ctx::Json option, ctx::Json *request_result);
+               int subscribe(const char *subject, ctx::Json option, ctx::Json *requestResult);
                int unsubscribe(const char *subject, ctx::Json option);
-               int read(const char *subject, ctx::Json option, ctx::Json *request_result);
-               int write(const char *subject, ctx::Json data, ctx::Json *request_result);
+               int read(const char *subject, ctx::Json option, ctx::Json *requestResult);
+               int write(const char *subject, ctx::Json data, ctx::Json *requestResult);
 
        private:
                static app_statistics_provider *__instance;
index d293ed4ae254e7779efd5122fedbd4e558d06a49..fdabb05c798f6d11d485af657dc98c2a8546f40a 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <sstream>
 #include <types_internal.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include <db_mgr.h>
 #include "app_stats_types.h"
 #include "db_handle.h"
@@ -214,5 +214,5 @@ void ctx::app_db_handle::reply_trigger_item(int error, ctx::Json &json_result)
        json_result.get(NULL, STATS_RANK, &val);
        results.set(NULL, STATS_RANK, val);
 
-       context_manager::reply_to_read(req_subject.c_str(), req_filter, error, results);
+       context_manager::replyToRead(req_subject.c_str(), req_filter, error, results);
 }
index bc744292a38eccce666ad8eca36c861b1757be4c..81a1d800c311b819b0fa2788948c39c2afdd6796 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <sstream>
 #include <types_internal.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include <db_mgr.h>
 #include "../shared/system_info.h"
 #include "media_stats_types.h"
@@ -120,5 +120,5 @@ void ctx::media_db_handle::reply_trigger_item(int error, ctx::Json &json_result)
        json_result.get(NULL, STATS_TOTAL_COUNT, &val);
        results.set(NULL, STATS_TOTAL_COUNT, val);
 
-       context_manager::reply_to_read(req_subject.c_str(), req_filter, error, results);
+       context_manager::replyToRead(req_subject.c_str(), req_filter, error, results);
 }
index e68fe6b787dbc17929b1aeb2259dd15a674e133c..feac91427ade5c7202836eac2b23491923e7de8e 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <glib.h>
 #include <string>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "media_stats_provider.h"
 #include "db_handle.h"
 #include "media_content_monitor.h"
@@ -35,7 +35,7 @@ ctx::media_statistics_provider::~media_statistics_provider()
        content_mon = NULL;
 }
 
-ctx::context_provider_iface *ctx::media_statistics_provider::create(void *data)
+ctx::ContextProviderBase *ctx::media_statistics_provider::create(void *data)
 {
        IF_FAIL_RETURN(!__instance, __instance);
 
@@ -67,11 +67,11 @@ bool ctx::media_statistics_provider::is_supported(const char* subject)
 
 void ctx::media_statistics_provider::submit_trigger_item()
 {
-       context_manager::register_trigger_item(MEDIA_SUBJ_MUSIC_FREQUENCY, OPS_READ,
+       context_manager::registerTriggerItem(MEDIA_SUBJ_MUSIC_FREQUENCY, OPS_READ,
                        "{" TRIG_DEF_TOTAL_COUNT "}",
                        "{" TRIG_DEF_TIME_OF_DAY "," TRIG_DEF_DAY_OF_WEEK "}");
 
-       context_manager::register_trigger_item(MEDIA_SUBJ_VIDEO_FREQUENCY, OPS_READ,
+       context_manager::registerTriggerItem(MEDIA_SUBJ_VIDEO_FREQUENCY, OPS_READ,
                        "{" TRIG_DEF_TOTAL_COUNT "}",
                        "{" TRIG_DEF_TIME_OF_DAY "," TRIG_DEF_DAY_OF_WEEK "}");
 }
@@ -83,7 +83,7 @@ bool ctx::media_statistics_provider::init()
        return true;
 }
 
-int ctx::media_statistics_provider::subscribe(const char* subject, ctx::Json option, ctx::Json* request_result)
+int ctx::media_statistics_provider::subscribe(const char* subject, ctx::Json option, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
@@ -93,7 +93,7 @@ int ctx::media_statistics_provider::unsubscribe(const char* subject, ctx::Json o
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::media_statistics_provider::read(const char* subject, ctx::Json option, ctx::Json* request_result)
+int ctx::media_statistics_provider::read(const char* subject, ctx::Json option, ctx::Json* requestResult)
 {
        media_db_handle *handle = new(std::nothrow) media_db_handle();
        IF_FAIL_RETURN_TAG(handle, ERR_OPERATION_FAILED, _E, "Memory allocation failed");
@@ -107,7 +107,7 @@ int ctx::media_statistics_provider::read(const char* subject, ctx::Json option,
        return ERR_NONE;
 }
 
-int ctx::media_statistics_provider::write(const char* subject, ctx::Json data, ctx::Json* request_result)
+int ctx::media_statistics_provider::write(const char* subject, ctx::Json data, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
index 72bb19864b4944b28d5519d95d9e737af63efcf8..ff695c6877ad26f6f54cba8bd25cc0f3a5698471 100644 (file)
 #ifndef __CONTEXT_MEDIA_STATS_PROVIDER_H__
 #define __CONTEXT_MEDIA_STATS_PROVIDER_H__
 
-#include <provider_iface.h>
+#include <ContextProviderBase.h>
 #include "media_stats_types.h"
 
 namespace ctx {
 
-       class media_statistics_provider : public context_provider_iface {
+       class media_statistics_provider : public ContextProviderBase {
        public:
-               static context_provider_iface *create(void *data);
+               static ContextProviderBase *create(void *data);
                static void destroy(void *data);
                static bool is_supported(const char *subject);
                static void submit_trigger_item();
 
-               int subscribe(const char* subject, ctx::Json option, ctx::Json* request_result);
+               int subscribe(const char* subject, ctx::Json option, ctx::Json* requestResult);
                int unsubscribe(const char* subject, ctx::Json option);
-               int read(const char* subject, ctx::Json option, ctx::Json* request_result);
-               int write(const char* subject, ctx::Json data, ctx::Json* request_result);
+               int read(const char* subject, ctx::Json option, ctx::Json* requestResult);
+               int write(const char* subject, ctx::Json data, ctx::Json* requestResult);
 
        private:
                static media_statistics_provider *__instance;
index f525b3d18b7272222c1e46a78e67d2f402a6b71e..159c5ca6b9518a8a81ab23465d6a251833f042e0 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <sstream>
 #include <types_internal.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include <db_mgr.h>
 #include "common_types.h"
 #include "db_handle_base.h"
@@ -215,12 +215,12 @@ void ctx::stats_db_handle_base::on_query_result_received(unsigned int query_id,
                } else {
                        _E("Invalid query result");
                        Json dummy;
-                       context_manager::reply_to_read(req_subject.c_str(), req_filter, ERR_OPERATION_FAILED, dummy);
+                       context_manager::replyToRead(req_subject.c_str(), req_filter, ERR_OPERATION_FAILED, dummy);
                }
        } else {
                Json results = "{\"" STATS_QUERY_RESULT "\":[]}";
                json_vector_to_array(records, results);
-               context_manager::reply_to_read(req_subject.c_str(), req_filter, error, results);
+               context_manager::replyToRead(req_subject.c_str(), req_filter, error, results);
        }
 
        delete this;
index a42e62554c56c888c003c591aa7c6e7a62fdec2e..1199a32551dba5428772c2ca58ca695894418878 100644 (file)
@@ -17,7 +17,7 @@
 #include <sstream>
 #include <contacts.h>
 #include <types_internal.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include <db_mgr.h>
 #include "social_stats_types.h"
 #include "db_handle.h"
@@ -158,5 +158,5 @@ void ctx::social_db_handle::reply_trigger_item(int error, ctx::Json &json_result
        json_result.get(NULL, STATS_RANK, &val);
        results.set(NULL, STATS_RANK, val);
 
-       context_manager::reply_to_read(req_subject.c_str(), req_filter, error, results);
+       context_manager::replyToRead(req_subject.c_str(), req_filter, error, results);
 }
index 90aa35b36c979450484fb17f55be2bdf84134daa..196b11eccea2340efa776ab048e64bbc15657523 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <types_internal.h>
 #include <Json.h>
-#include <context_mgr.h>
+#include <ContextManager.h>
 #include "social_stats_provider.h"
 #include "db_handle.h"
 #include "log_aggregator.h"
@@ -34,7 +34,7 @@ ctx::social_statistics_provider::~social_statistics_provider()
        delete aggregator;
 }
 
-ctx::context_provider_iface *ctx::social_statistics_provider::create(void *data)
+ctx::ContextProviderBase *ctx::social_statistics_provider::create(void *data)
 {
        IF_FAIL_RETURN(!__instance, __instance);
 
@@ -66,7 +66,7 @@ bool ctx::social_statistics_provider::is_supported(const char* subject)
 
 void ctx::social_statistics_provider::submit_trigger_item()
 {
-       context_manager::register_trigger_item(SOCIAL_SUBJ_FREQUENCY, OPS_READ,
+       context_manager::registerTriggerItem(SOCIAL_SUBJ_FREQUENCY, OPS_READ,
                        "{" TRIG_DEF_RANK "," TRIG_DEF_TOTAL_COUNT "}",
                        "{"
                                "\"Address\":{\"type\":\"string\"},"
@@ -81,7 +81,7 @@ bool ctx::social_statistics_provider::init()
        return true;
 }
 
-int ctx::social_statistics_provider::subscribe(const char* subject, ctx::Json option, ctx::Json* request_result)
+int ctx::social_statistics_provider::subscribe(const char* subject, ctx::Json option, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
@@ -91,7 +91,7 @@ int ctx::social_statistics_provider::unsubscribe(const char* subject, ctx::Json
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::social_statistics_provider::read(const char* subject, ctx::Json option, ctx::Json* request_result)
+int ctx::social_statistics_provider::read(const char* subject, ctx::Json option, ctx::Json* requestResult)
 {
        ctx::social_db_handle *handle = new(std::nothrow) ctx::social_db_handle();
        IF_FAIL_RETURN_TAG(handle, ERR_OPERATION_FAILED, _E, "Memory allocation failed");
@@ -105,7 +105,7 @@ int ctx::social_statistics_provider::read(const char* subject, ctx::Json option,
        return ERR_NONE;
 }
 
-int ctx::social_statistics_provider::write(const char* subject, ctx::Json data, ctx::Json* request_result)
+int ctx::social_statistics_provider::write(const char* subject, ctx::Json data, ctx::Json* requestResult)
 {
        return ERR_NOT_SUPPORTED;
 }
index 7ba803ddab1d8d1cf0e2da888a23c3d611534c65..1666b78ebaed56209e5c98027468ce07eaaed28d 100644 (file)
 #ifndef __CONTEXT_SOCIAL_STATS_PROVIDER_H__
 #define __CONTEXT_SOCIAL_STATS_PROVIDER_H__
 
-#include <provider_iface.h>
+#include <ContextProviderBase.h>
 #include "social_stats_types.h"
 
 namespace ctx {
 
-       class social_statistics_provider : public context_provider_iface {
+       class social_statistics_provider : public ContextProviderBase {
        public:
-               static context_provider_iface *create(void *data);
+               static ContextProviderBase *create(void *data);
                static void destroy(void *data);
                static bool is_supported(const char *subject);
                static void submit_trigger_item();
 
-               int subscribe(const char* subject, ctx::Json option, ctx::Json* request_result);
+               int subscribe(const char* subject, ctx::Json option, ctx::Json* requestResult);
                int unsubscribe(const char* subject, ctx::Json option);
-               int read(const char* subject, ctx::Json option, ctx::Json* request_result);
-               int write(const char* subject, ctx::Json data, ctx::Json* request_result);
+               int read(const char* subject, ctx::Json option, ctx::Json* requestResult);
+               int write(const char* subject, ctx::Json data, ctx::Json* requestResult);
 
        private:
                static social_statistics_provider *__instance;
index 13e9c4031b270a6e81a43b8de70a5f9650cf88fb..2d305ebd9fa698c400f394c1fd5ef3f0de366c21 100644 (file)
@@ -14,8 +14,8 @@
  */
 
 #include <types_internal.h>
-#include <context_mgr.h>
-#include <provider_iface.h>
+#include <ContextManager.h>
+#include <ContextProviderBase.h>
 #include <statistics_context_provider.h>
 
 #include "app/app_stats_provider.h"
 #endif
 
 template<typename provider>
-void register_provider(const char *subject, const char *privilege)
+void registerProvider(const char *subject, const char *privilege)
 {
        if (!provider::is_supported(subject))
                return;
 
-       ctx::context_provider_info provider_info(provider::create, provider::destroy, NULL, privilege);
-       ctx::context_manager::register_provider(subject, provider_info);
+       ctx::ContextProviderInfo providerInfo(provider::create, provider::destroy, NULL, privilege);
+       ctx::context_manager::registerProvider(subject, providerInfo);
 }
 
 EXTAPI bool ctx::init_statistics_context_provider()
 {
        app_statistics_provider::create(NULL);
-       register_provider<app_statistics_provider>(APP_SUBJ_RECENTLY_USED, APP_HISTORY_PRIV);
-       register_provider<app_statistics_provider>(APP_SUBJ_FREQUENTLY_USED, APP_HISTORY_PRIV);
-       register_provider<app_statistics_provider>(APP_SUBJ_RARELY_USED, APP_HISTORY_PRIV);
-       register_provider<app_statistics_provider>(APP_SUBJ_PEAK_TIME, APP_HISTORY_PRIV);
-       register_provider<app_statistics_provider>(APP_SUBJ_COMMON_SETTING, APP_HISTORY_PRIV);
-       register_provider<app_statistics_provider>(APP_SUBJ_FREQUENCY, APP_HISTORY_PRIV);
+       registerProvider<app_statistics_provider>(APP_SUBJ_RECENTLY_USED, APP_HISTORY_PRIV);
+       registerProvider<app_statistics_provider>(APP_SUBJ_FREQUENTLY_USED, APP_HISTORY_PRIV);
+       registerProvider<app_statistics_provider>(APP_SUBJ_RARELY_USED, APP_HISTORY_PRIV);
+       registerProvider<app_statistics_provider>(APP_SUBJ_PEAK_TIME, APP_HISTORY_PRIV);
+       registerProvider<app_statistics_provider>(APP_SUBJ_COMMON_SETTING, APP_HISTORY_PRIV);
+       registerProvider<app_statistics_provider>(APP_SUBJ_FREQUENCY, APP_HISTORY_PRIV);
        app_statistics_provider::submit_trigger_item();
 
 #ifndef _DISABLE_PREDICTION_ENGINE_
@@ -60,28 +60,28 @@ EXTAPI bool ctx::init_statistics_context_provider()
 
 #ifdef _MOBILE_
        media_statistics_provider::create(NULL);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_MUSIC, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_VIDEO, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_MUSIC, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_VIDEO, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_MUSIC_FREQUENCY, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_VIDEO_FREQUENCY, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_MUSIC, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_VIDEO, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_MUSIC, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_VIDEO, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_MUSIC_FREQUENCY, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_VIDEO_FREQUENCY, MEDIA_HISTORY_PRIV);
        media_statistics_provider::submit_trigger_item();
 
        social_statistics_provider::create(NULL);
-       register_provider<social_statistics_provider>(SOCIAL_SUBJ_FREQ_ADDRESS, SOCIAL_HISTORY_PRIV);
-       register_provider<social_statistics_provider>(SOCIAL_SUBJ_FREQUENCY, SOCIAL_HISTORY_PRIV);
+       registerProvider<social_statistics_provider>(SOCIAL_SUBJ_FREQ_ADDRESS, SOCIAL_HISTORY_PRIV);
+       registerProvider<social_statistics_provider>(SOCIAL_SUBJ_FREQUENCY, SOCIAL_HISTORY_PRIV);
        social_statistics_provider::submit_trigger_item();
 #endif
 
 #ifdef _TV_
        media_statistics_provider::create(NULL);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_MUSIC, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_VIDEO, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_MUSIC, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_VIDEO, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_MUSIC_FREQUENCY, MEDIA_HISTORY_PRIV);
-       register_provider<media_statistics_provider>(MEDIA_SUBJ_VIDEO_FREQUENCY, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_MUSIC, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_VIDEO, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_MUSIC, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_COMMON_SETTING_FOR_VIDEO, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_MUSIC_FREQUENCY, MEDIA_HISTORY_PRIV);
+       registerProvider<media_statistics_provider>(MEDIA_SUBJ_VIDEO_FREQUENCY, MEDIA_HISTORY_PRIV);
        media_statistics_provider::submit_trigger_item();
 #endif