From e17e31940a40cc0d93a7f7195ab8d944b0d3f31b Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 3 Feb 2020 08:20:07 +0900 Subject: [PATCH] Add new APIs for launcher service Adds: - aul_launcher_service_notify_animation_started() - aul_launcher_service_notify_animation_finished() Requires: - https://review.tizen.org/gerrit/#/c/platform/core/appfw/widget-viewer/+/223659/ - https://review.tizen.org/gerrit/#/c/platform/core/appfw/aul-1/+/223665/ - https://review.tizen.org/gerrit/#/c/platform/core/appfw/amd/+/223673/ Change-Id: I766debf799a2c33d08330029448ad209775fe009 Signed-off-by: Hwankyu Jhun --- include/aul_cmd.h | 2 ++ include/aul_key.h | 6 ++++++ include/aul_launcher_service.h | 26 +++++++++++++++++++++++++ src/aul_cmd.c | 4 ++++ src/aul_launcher_service.c | 43 ++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 79 insertions(+), 2 deletions(-) diff --git a/include/aul_cmd.h b/include/aul_cmd.h index 0a7d201..b619789 100755 --- a/include/aul_cmd.h +++ b/include/aul_cmd.h @@ -173,6 +173,8 @@ enum app_cmd { APP_IS_RUNNING_V2 = 134, ANR_NOTIFY = 135, APP_GET_RUNNING_CONTEXT = 136, + LAUNCHER_SERVICE_NOTIFY_ANIMATION_STARTED = 137, + LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED = 138, APP_CMD_MAX }; diff --git a/include/aul_key.h b/include/aul_key.h index d56dee5..4b4b4df 100644 --- a/include/aul_key.h +++ b/include/aul_key.h @@ -738,3 +738,9 @@ * @since_tizen 5.5 */ #define AUL_K_LAUNCHER_SERVICE_SERIAL "__K_LAUNCHER_SERVICE_SERIAL__" + +/** + * @brief Definition for AUL: The event of the launcher service. + * @since_tizen 5.5 + */ +#define AUL_K_LAUNCHER_SERVICE_EVENT "__K_LAUNCHER_SERVICE_EVENT__" diff --git a/include/aul_launcher_service.h b/include/aul_launcher_service.h index f97526b..5674367 100644 --- a/include/aul_launcher_service.h +++ b/include/aul_launcher_service.h @@ -100,6 +100,32 @@ int aul_launcher_service_listen(aul_launcher_service_h handle); */ int aul_launcher_service_destroy(aul_launcher_service_h handle); +/** + * @brief Notifies that the animation is started. + * @since_tizen 5.5 + * + * @return 0 on success, + * otherwise a negative error value + * + * @see aul_launcher_service_notify_animation_finished() + * + * @remarks This function is only available for App Framework internally. + */ +int aul_launcher_service_notify_animation_started(void); + +/** + * @brief Notifies that the animation is finished. + * @since_tizen 5.5 + * + * @return 0 on success, + * otherwise a negative error value + * + * @see aul_launcher_service_notify_animation_started() + * + * @remarks This function is only available for App Framework internally. + */ +int aul_launcher_service_notify_animation_finished(void); + #ifdef __cplusplus } #endif diff --git a/src/aul_cmd.c b/src/aul_cmd.c index d33be74..0535a14 100755 --- a/src/aul_cmd.c +++ b/src/aul_cmd.c @@ -298,6 +298,10 @@ API const char *aul_cmd_convert_to_string(int cmd) return "ANR_NOTIFY"; case APP_GET_RUNNING_CONTEXT: return "APP_GET_RUNNING_CONTEXT"; + case LAUNCHER_SERVICE_NOTIFY_ANIMATION_STARTED: + return "LAUNCHER_SERVICE_NOTIFY_ANIMATION_STARTED"; + case LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED: + return "LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED"; default: return "CUSTOM_COMMAND"; } diff --git a/src/aul_launcher_service.c b/src/aul_launcher_service.c index 9deeb25..835c18d 100644 --- a/src/aul_launcher_service.c +++ b/src/aul_launcher_service.c @@ -19,10 +19,13 @@ #include #include #include +#include -#include "aul_launcher_service.h" -#include "aul_app_com.h" #include "aul_api.h" +#include "aul_app_com.h" +#include "aul_error.h" +#include "aul_launcher_service.h" +#include "aul_sock.h" #include "aul_util.h" struct aul_launcher_service_s { @@ -144,3 +147,39 @@ API int aul_launcher_service_destroy(aul_launcher_service_h handle) return AUL_R_OK; } + +static int __send_request(int cmd) +{ + int ret; + + ret = aul_sock_send_raw(AUL_UTIL_PID, getuid(), cmd, + NULL, 0, AUL_SOCK_NOREPLY); + if (ret != 0) { + _E("Failed to send command(%d). error(%d)", cmd, ret); + return aul_error_convert(ret); + } + + return 0; +} + +API int aul_launcher_service_notify_animation_started(void) +{ + int ret; + + ret = __send_request(LAUNCHER_SERVICE_NOTIFY_ANIMATION_STARTED); + if (ret < 0) + return ret; + + return AUL_R_OK; +} + +API int aul_launcher_service_notify_animation_finished(void) +{ + int ret; + + ret = __send_request(LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED); + if (ret < 0) + return ret; + + return AUL_R_OK; +} -- 2.7.4