Add new APIs for launcher service 65/223665/4
authorHwankyu Jhun <h.jhun@samsung.com>
Sun, 2 Feb 2020 23:20:07 +0000 (08:20 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 3 Feb 2020 02:01:35 +0000 (11:01 +0900)
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 <h.jhun@samsung.com>
include/aul_cmd.h
include/aul_key.h
include/aul_launcher_service.h
src/aul_cmd.c
src/aul_launcher_service.c

index 0a7d201..b619789 100755 (executable)
@@ -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
 };
index d56dee5..4b4b4df 100644 (file)
  * @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__"
index f97526b..5674367 100644 (file)
@@ -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
index d33be74..0535a14 100755 (executable)
@@ -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";
        }
index 9deeb25..835c18d 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <glib.h>
+#include <bundle_internal.h>
 
-#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;
+}