static int icon_index = 0;
static int updated_while_lcd_off = 0;
-static void set_app_state(void* data)
+static void set_app_state(void *data)
{
downloading.ad = data;
}
-static void show_image_icon(void* data, int index)
+static void show_image_icon(void *data, int index)
{
downloading.img_obj.data = icon_path[index];
icon_show(&downloading);
icon_hide(&downloading);
}
-static Eina_Bool show_downloading_icon_cb(void* data)
+static Eina_Bool show_downloading_icon_cb(void *data)
{
- show_image_icon(data,icon_index);
+ show_image_icon(data, icon_index);
icon_index++;
icon_index = (icon_index % ICON_NUM) ? icon_index : 0;
return ECORE_CALLBACK_RENEW;
}
-static void show_downloading_icon(void* data)
+static void show_downloading_icon(void *data)
{
- if(timer==NULL)
- {
+ if (timer == NULL)
timer = ecore_timer_add(TIMER_INTERVAL, show_downloading_icon_cb, data);
- }
else
- {
_E("show_downloading_icon!, timer");
- }
}
static void hide_downloading_icon(void)
static void indicator_downloading_change_cb(keynode_t *node, void *data)
{
- /*int status = 0;*/
- int result = 0;
+ int status = 0;
+ int ret = 0;
retm_if(data == NULL, "Invalid parameter!");
- if(icon_get_update_flag()==0)
- {
+ if (icon_get_update_flag() == 0) {
updated_while_lcd_off = 1;
return;
}
updated_while_lcd_off = 0;
-/* if (vconf_get_int(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, &status) == 0)
- {
- result = result | status;
- } else {
- _E("Error getting VCONFKEY_WIFI_DIRECT_RECEIVING_STATE value");
- }*/
+ ret = vconf_get_int(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, &status);
+ retm_if(ret != 0,"vconf_get_int failed");
- if (result == 1) {
+ if (status == 1)
show_downloading_icon(data);
-
- } else {
+ else
hide_downloading_icon();
- }
}
static void indicator_downloading_pm_state_change_cb(keynode_t *node, void *data)
retm_if(data == NULL, "Invalid parameter!");
- if (vconf_get_int(VCONFKEY_PM_STATE, &status) < 0)
- {
+ if (vconf_get_int(VCONFKEY_PM_STATE, &status) < 0) {
_E("Error getting VCONFKEY_PM_STATE value");
- if (timer != NULL)
- {
+ if (timer != NULL) {
ecore_timer_del(timer);
timer = NULL;
}
-
return;
}
- if(status == VCONFKEY_PM_STATE_LCDOFF)
- {
+ if (status == VCONFKEY_PM_STATE_LCDOFF)
if (timer != NULL) {
ecore_timer_del(timer);
timer = NULL;
}
- }
}
static int wake_up_cb(void *data)
{
if(updated_while_lcd_off == 0 && downloading.obj_exist == EINA_FALSE)
- {
return OK;
- }
indicator_downloading_change_cb(NULL, data);
return OK;
static int register_downloading_module(void *data)
{
int ret = 0;
-
retvm_if(data == NULL, FAIL, "Invalid parameter!");
set_app_state(data);
-// ret = ret | vconf_notify_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, indicator_downloading_change_cb, data);
+ ret = vconf_notify_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE,
+ indicator_downloading_change_cb, data);
+ retvm_if(ret != 0, FAIL, "vconf_notify_key_changed failed");
- ret = ret | vconf_notify_key_changed(VCONFKEY_PM_STATE,
- indicator_downloading_pm_state_change_cb, data);
+ ret = vconf_notify_key_changed(VCONFKEY_PM_STATE,
+ indicator_downloading_pm_state_change_cb, data);
+ if(ret != 0) _E("vconf_notify_key_changed failed");
indicator_downloading_change_cb(NULL, data);
- return ret;
+ return OK;
}
static int unregister_downloading_module(void)
{
int ret = 0;
-// ret = ret | vconf_ignore_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, indicator_downloading_change_cb);
-
- ret = ret | vconf_ignore_key_changed(VCONFKEY_PM_STATE,
- indicator_downloading_pm_state_change_cb);
+ ret |= vconf_ignore_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE,
+ indicator_downloading_change_cb);
+ ret |= vconf_ignore_key_changed(VCONFKEY_PM_STATE,
+ indicator_downloading_pm_state_change_cb);
return ret;
}