#include <Eina.h>
-#include <vconf.h>
#include <app_preference.h>
#include "common.h"
static unsigned int update_icon_flag = 1; // For battery problem
-
-
static void _reset_on_timer_icon_animation(icon_s *icon)
{
ret_if(!icon);
-static void _show_hide_more_noti(win_info* win,int val)
+static void _show_hide_more_noti(win_info* win, bool show)
{
- static int bShow = 0;
-
- if (bShow == val) {
- return;
- }
-
- bShow = val;
-
- if (val == 1) {
- preference_set_int(VCONFKEY_INDICATOR_SHOW_MORE_NOTI, 1);
- } else {
- preference_set_int(VCONFKEY_INDICATOR_SHOW_MORE_NOTI, 0);
- }
+ int err = preference_set_boolean(INDICATOR_MORE_NOTI, show);
+ retm_if(err != PREFERENCE_ERROR_NONE, "preference_set_boolean failed: %s", get_error_message(err));
}
-
-
void icon_handle_more_notify_icon(win_info* win)
{
retif(win == NULL, , "Invalid parameter!");
DBG("PORT :: %d", (system_cnt + minictrl_cnt + noti_cnt));
if((system_cnt + minictrl_cnt + noti_cnt) > MAX_NOTI_ICONS_PORT)
{
- _show_hide_more_noti(win,1);
+ _show_hide_more_noti(win, true);
DBG("PORT :: handle_more_notify_show");
}
else
{*/
- _show_hide_more_noti(win,0);
+ _show_hide_more_noti(win, false);
DBG("PORT :: handle_more_notify_hide");
/*}
}*/
#include <stdio.h>
#include <stdlib.h>
-#include <vconf.h>
#include <app_preference.h>
#include "common.h"
#include "icon.h"
#include "modules.h"
#include "main.h"
+#include "log.h"
#define ICON_PRIORITY INDICATOR_PRIORITY_NOTI_MIN
#define MODULE_NAME "more_notify"
static int updated_while_lcd_off = 0;
-static int bShow = 0;
+static bool bShow = 0;
icon_s more_notify = {
.name = MODULE_NAME,
-static void _handle_more_notify_icon(win_info* win,int val)
+static void _handle_more_notify_icon(win_info* win, bool val)
{
retif(win == NULL, , "Invalid parameter!");
- if(bShow == val)
- {
+ if(bShow == val) {
return;
}
DBG("val %d", val);
- if(val==1)
- {
+ if (val) {
show_image_icon_by_win(win);
DBG("_handle_more_notify_show");
- }
- else
- {
+ } else {
hide_image_icon_by_win(win);
DBG("_handle_more_notify_hide");
}
static void indicator_more_notify_change_cb(const char *key, void *data)
{
struct appdata *ad = (struct appdata *)(more_notify.ad);
- int val = 0;
+ bool val = 0;
retif(data == NULL, , "Invalid parameter!");
DBG("indicator_more_notify_change_cb");
win_info* win = NULL;
- preference_get_int(key, &val);
-
- if (strcmp(key, VCONFKEY_INDICATOR_SHOW_MORE_NOTI) == 0) {
+ if (strcmp(key, INDICATOR_MORE_NOTI) == 0) {
win = &(ad->win);
} else {
SECURE_ERR("invalid val %s",key);
return;
}
- _handle_more_notify_icon(win,val);
+ int err = preference_get_boolean(key, &val);
+ retm_if(err != PREFERENCE_ERROR_NONE, "preference_get_boolean failed: %s", get_error_message(err));
+
+ _handle_more_notify_icon(win, val);
return;
}
set_app_state(data);
- preference_set_changed_cb(VCONFKEY_INDICATOR_SHOW_MORE_NOTI, indicator_more_notify_change_cb, data);
+ preference_set_changed_cb(INDICATOR_MORE_NOTI, indicator_more_notify_change_cb, data);
return OK;
}
static int unregister_more_notify_module(void)
{
- preference_unset_changed_cb(VCONFKEY_INDICATOR_SHOW_MORE_NOTI);
+ preference_unset_changed_cb(INDICATOR_MORE_NOTI);
return OK;
}