From 8c0f4db2b474e76f80a66163b31571b0255b9ec5 Mon Sep 17 00:00:00 2001 From: Junghyun Kim Date: Tue, 11 Sep 2012 16:23:57 +0900 Subject: [PATCH] Add retry cnt for fail to get running app info Change-Id: Id03afb72ad6bd5cf203891f7c1fb58faa52c4d4e --- src/_genlist.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/_genlist.c b/src/_genlist.c index 480db80..43089d5 100755 --- a/src/_genlist.c +++ b/src/_genlist.c @@ -679,13 +679,21 @@ void _set_genlist(struct appdata *ad) _D("func\n"); retm_if(ad == NULL, "Invalid argument: appdata is NULL\n"); int ret = AUL_R_ERROR; + int retry_cnt = 0; + int sleep_value = 1000; _init_grp_cnt(); - ret = aul_app_get_running_app_info(runapp_info_get, ad); + while (ret != AUL_R_OK && retry_cnt < 5) { + usleep(sleep_value); + ret = aul_app_get_running_app_info(runapp_info_get, ad); - if (ret != AUL_R_OK) { - _D("Fail to get running app information from ail"); + if (ret != AUL_R_OK) { + _D("Fail to get running app information from ail"); + } + + retry_cnt++; + sleep_value *= 2; } taskmanager_get_history_app_info(ad); -- 2.7.4