From 70b235a3c85e98a2a9cee08cea9f7cf7223f77b0 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Tue, 20 Dec 2016 17:03:41 +0900 Subject: [PATCH] Add some apps into the blacklist/whitelist of kaskit blacklist : +org.tizen.phone, +org.tizen.message, -org.tizen.dpm-toolkit whitelist : +org.tizen.taskmgr Change-Id: Ic94a41cc4f57a4d58d1e5b0e027a4848c2f19d2b Signed-off-by: Sungbae Yoo --- tools/apps/kaskit/src/main.c | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/tools/apps/kaskit/src/main.c b/tools/apps/kaskit/src/main.c index 4ca3427..06c594c 100644 --- a/tools/apps/kaskit/src/main.c +++ b/tools/apps/kaskit/src/main.c @@ -26,9 +26,14 @@ static package_manager_h __pkg_mgr; -static const char *__pkg_blacklist[] = { +static const char *__app_whitelist[] = { + "org.tizen.task-mgr", + NULL +}; +static const char *__app_blacklist[] = { + "org.tizen.phone", + "org.tizen.message", "org.tizen.setting", - "org.tizen.dpm-toolkit", NULL }; @@ -73,11 +78,22 @@ static bool __pkg_is_removable(const char *pkg_id) return removable; } -static bool __pkg_is_in_blacklist(const char *pkg_id) +static bool __app_is_in_blacklist(const char *app_id) +{ + int i; + for (i = 0; __app_blacklist[i] != NULL; i++) { + if (strcmp(app_id, __app_blacklist[i]) == 0) { + return true; + } + } + return false; +} + +static bool __app_is_in_whitelist(const char *app_id) { int i; - for (i = 0; __pkg_blacklist[i] != NULL; i++) { - if (strcmp(pkg_id, __pkg_blacklist[i]) == 0) { + for (i = 0; __app_whitelist[i] != NULL; i++) { + if (strcmp(app_id, __app_whitelist[i]) == 0) { return true; } } @@ -89,27 +105,27 @@ static bool __get_app_info_cb(app_info_h app_h, void *user_data) struct app_icon_s app = {NULL, }; bool nodisplay = true; - app_info_is_nodisplay(app_h, &nodisplay); - if (nodisplay) { + app_info_get_app_id(app_h, &app.id); + if (__app_is_in_blacklist(app.id)) { + free(app.id); return true; } - app_info_get_package(app_h, &app.package); - - if (__pkg_is_in_blacklist(app.package)) { - free(app.package); + app_info_is_nodisplay(app_h, &nodisplay); + if (nodisplay && !__app_is_in_whitelist(app.id)) { + free(app.id); return true; } if (user_data == NULL || !strncmp(user_data, app.package, PATH_MAX)) { - app_info_get_app_id(app_h, &app.id); app_info_get_label(app_h, &app.label); app_info_get_icon(app_h, &app.icon); + app_info_get_package(app_h, &app.package); app.removable = __pkg_is_removable(app.package); ecore_main_loop_thread_safe_call_sync(__create_app_icon, &app); - free(app.id); + free(app.package); if (app.label != NULL) { free(app.label); } @@ -118,7 +134,7 @@ static bool __get_app_info_cb(app_info_h app_h, void *user_data) } } - free(app.package); + free(app.id); return true; } -- 2.7.4