diff options
author | Radoslaw Czerski <r.czerski@samsung.com> | 2016-03-07 11:18:49 +0100 |
---|---|---|
committer | Radoslaw Czerski <r.czerski@samsung.com> | 2016-03-10 15:12:45 +0100 |
commit | b416c296a7d5c2990cde4df95d7b08211750c7ac (patch) | |
tree | 666d839d2a99e9d66b568666c8d62edeb5cd5185 | |
parent | 97651fc06f5b833d1823070e29c6372ab814b3e1 (diff) | |
download | indicator-win-b416c296a7d5c2990cde4df95d7b08211750c7ac.tar.gz indicator-win-b416c296a7d5c2990cde4df95d7b08211750c7ac.tar.bz2 indicator-win-b416c296a7d5c2990cde4df95d7b08211750c7ac.zip |
modules/info/lowmem: Bugfix.
Now icon shows up only when available memory is <=5%, not >5%.
Change-Id: Ie97b78e03e6907e6da159bc4f18da8a7926739c9
Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
-rw-r--r-- | src/modules/information/lowmem.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/information/lowmem.c b/src/modules/information/lowmem.c index e2a637b..98dd282 100644 --- a/src/modules/information/lowmem.c +++ b/src/modules/information/lowmem.c @@ -69,6 +69,8 @@ static void set_app_state(void* data) static void show_image_icon(void) { + _D("Show icon"); + if(bShown == 1) return; @@ -80,6 +82,7 @@ static void show_image_icon(void) static void hide_image_icon(void) { + _D("Hide icon"); icon_hide(&lowmem); bShown = 0; @@ -99,21 +102,21 @@ static void on_changed_receive_cb(const char *event_name, bundle *event_data, vo retm_if ((!event_name || strcmp(event_name, SYSTEM_EVENT_LOW_MEMORY)),"Invalid event: %s", event_name); - _D("lowmem signal Received"); + _D("\"Low memory changed\" signal received"); int ret = bundle_get_str(event_data, EVENT_KEY_LOW_MEMORY, &val); retm_if (ret != BUNDLE_ERROR_NONE,"bundle_get_str failed for %s: %d", EVENT_KEY_LOW_MEMORY, ret); retm_if (!val, "Empty bundle value for %s", EVENT_KEY_LOW_MEMORY); - if (strcmp(val, EVENT_VAL_MEMORY_NORMAL)) + if (!strcmp(val, EVENT_VAL_MEMORY_NORMAL)) hide_image_icon(); - else if (strcmp(val, EVENT_VAL_MEMORY_HARD_WARNING)) + else if (!strcmp(val, EVENT_VAL_MEMORY_HARD_WARNING)) show_image_icon(); - else if (strcmp(val, EVENT_VAL_MEMORY_SOFT_WARNING)) + else if (!strcmp(val, EVENT_VAL_MEMORY_SOFT_WARNING)) show_image_icon(); else - ERR("Unrecognized %s value %s", EVENT_KEY_LOW_MEMORY, val); + _E("Unrecognized %s value %s", EVENT_KEY_LOW_MEMORY, val); } static void event_cleaner(void) @@ -130,7 +133,7 @@ static void event_cleaner(void) static int event_listener_add(void) { if (handler) { - DBG("alreay exist"); + _D("alreay exist"); return FAIL; } @@ -166,7 +169,6 @@ static int unregister_lowmem_module(void) bool storage_cb (int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data) { - if (type == STORAGE_TYPE_INTERNAL) { int *s_id = (int *)user_data; *s_id = storage_id; |