Change to operate in on-demand mode
[platform/core/connectivity/stc-manager.git] / src / stc-statistics.c
index 70cf48c..0d5a761 100755 (executable)
@@ -21,9 +21,6 @@
 
 #define STATISTICS_DBUS_ERROR_NAME "net.stc.statistics.Error.Failed"
 
-#define STC_DBUS_REPLY(invocation, parameters) \
-       g_dbus_method_invocation_return_value((invocation), parameters);
-
 #define STC_STATISTICS_DBUS_REPLY_ERROR(invocation, err_num) \
        g_dbus_method_invocation_return_dbus_error((invocation), \
                                                   STATISTICS_DBUS_ERROR_NAME, \
@@ -36,7 +33,9 @@ static const gchar *stc_err_strs[] = {
        "OUT_OF_MEMORY",
        "INVALID_PARAMETER",
        "NO_DATA",
+       "ALREADY_DATA",
        "UNINITIALIZED",
+       "PERMISSION_DENIED",
        "NOTIMPL"
 };
 
@@ -248,6 +247,8 @@ gboolean handle_statistics_get_all(StcStatistics *object,
        GVariant *return_parameters = NULL;
        stc_error_e ret;
 
+       stc_set_keep_alive(TRUE);
+
        /* Total statistics since epoch */
        rule.from = epoch;
        rule.to = cur_time;
@@ -295,6 +296,8 @@ gboolean handle_statistics_init(StcStatistics *object,
 {
        __STC_LOG_FUNC_ENTER__;
 
+       stc_set_keep_alive(TRUE);
+
        STC_LOGI("stc statistics initialized");
        stc_statistics_complete_init(object, invocation);
 
@@ -316,6 +319,8 @@ gboolean handle_statistics_get(StcStatistics *object,
        GVariant *return_parameters = NULL;
        stc_error_e ret;
 
+       stc_set_keep_alive(TRUE);
+
        /* Total statistics since epoch */
        rule.from = epoch;
        rule.to = cur_time;
@@ -368,6 +373,8 @@ gboolean handle_statistics_reset(StcStatistics *object,
        GVariant *return_parameters = NULL;
        stc_error_e ret;
 
+       stc_set_keep_alive(TRUE);
+
        if (reset_rule != NULL) {
                DEBUG_GDBUS_VARIANT("Selection rule: ", reset_rule);
                GVariantIter *iter = NULL;