From d148d7fac4ea933d0819fbc1c80be92c42a9a218 Mon Sep 17 00:00:00 2001 From: Sungbae Yoo Date: Thu, 20 Oct 2016 11:45:31 +0900 Subject: [PATCH] Add to remove the shortcut when container is removed Signed-off-by: Sungbae Yoo Change-Id: I04fc0f358ec32a9873839ba1af16084144f01a7d --- tools/apps/keyguard/src/main.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/apps/keyguard/src/main.c b/tools/apps/keyguard/src/main.c index f04bc21..8ddae52 100644 --- a/tools/apps/keyguard/src/main.c +++ b/tools/apps/keyguard/src/main.c @@ -51,7 +51,7 @@ unsigned int _get_left_attempts() { unsigned int attempt = 0, max_attempt = 0, expire_sec; - auth_passwd_check_passwd_state(AUTH_PWD_NORMAL, &attempt, &max_attempt, &expire_sec); + auth_passwd_check_passwd_state(AUTH_PWD_NORMAL, &attempt, &max_attempt, &expire_sec); if (max_attempt == 0) { return 0xffffffff; @@ -80,6 +80,11 @@ static void __add_shortcut(const char* krate_name) shortcut_add_to_home(krate_name, LAUNCH_BY_URI, uri, ICON_PATH "/shortcut_icon.png", 0, NULL, NULL); } +static void __remove_shortcut(const char* krate_name) +{ + shortcut_remove_from_home(krate_name, NULL, NULL); +} + static bool __app_create(void *data) { return true; @@ -128,6 +133,13 @@ static void __app_control(app_control_h app_control, void *data) __add_shortcut(krate_name); ui_app_exit(); return; + } else if (strncmp(tmp, "cleanup/", sizeof("cleanup/") - 1) == 0) { + char *krate_name; + + krate_name = tmp + sizeof("cleanup/") - 1; + __remove_shortcut(krate_name); + ui_app_exit(); + return; } else if (strncmp(tmp, "enter/", sizeof("enter/") - 1) == 0) { char* krate_name, *launch_parameter; char new_uri[PATH_MAX]; @@ -137,7 +149,7 @@ static void __app_control(app_control_h app_control, void *data) if (launch_parameter != NULL) { *(launch_parameter++) = '\0'; if (launch_parameter[0] == '\0') { - launch_parameter = KASKIT_PACKAGE; + launch_parameter = KASKIT_PACKAGE; } } else { launch_parameter = KASKIT_PACKAGE; @@ -153,7 +165,7 @@ static void __app_control(app_control_h app_control, void *data) __launch_krate_app(krate_name, app_control); ui_app_exit(); return; - }else if (strncmp(tmp, "launch/", sizeof("launch/") - 1) == 0) { + } else if (strncmp(tmp, "launch/", sizeof("launch/") - 1) == 0) { char* app_id; app_id = tmp + sizeof("launch/") - 1; -- 2.7.4