#define AMD_NOTI_MSG_LAUNCH_MANAGER_APP_LAUNCHED \
"launch_manager.app.launched"
+/**
+ * @brief Definition for the notification message: The app starts.
+ * @details Input: arg1(int) The process ID.\n
+ * @since_tizen 7.0
+ *
+ * @see DispatchAppNotifyStart()
+ */
+#define AMD_NOTI_MSG_APP_STATUS_APP_START \
+ "app_status.app_start"
+
/**
* @brief Definition for the notification message: The app process group set.
* @details Input: arg1(int) The leader process ID.\n
* Input: arg2(int) The sub process ID.\n
* @since_tizen 8.0
- *
+ *
* @see __dispatch_app_set_process_group()
*/
#define AMD_NOTI_MSG_UTIL_APP_SET_PROCESS_GROUP \
* @details Input: arg1(int) The leader process ID.\n
* Input: arg2(int) The sub process ID.\n
* @since_tizen 8.0
- *
+ *
* @see __app_group_context_set_status()
*/
#define AMD_NOTI_MSG_APP_GROUP_SET \
int pid = amd_app_status_get_pid(app_status);
uid_t uid;
proc_context *ctx;
- int operation_state;
ctx = __find_proc_context(pid);
if (ctx) {
__watchdog.proc_contexts = g_list_append(__watchdog.proc_contexts, ctx);
+ return AMD_NOTI_CONTINUE;
+}
+
+static int __on_app_status_app_start(const char *msg, int arg1, int arg2,
+ void *arg3, bundle *arg4)
+{
+ pid_t pid = arg1;
+ proc_context *ctx;
+ int operation_state;
+ int ret;
+
operation_state = _watchdog_config_get_operation_state();
- if (operation_state == WATCHDOG_ENABLE_BY_DEFAULT) {
- __watchdog_set_timer(ctx);
- ctx->watchdog_enable = true;
- _watchdog_logger_print("ENABLE", "pid(%d), appid(%s)",
- pid, amd_app_status_get_appid(app_status));
+ if (operation_state != WATCHDOG_ENABLE_BY_DEFAULT)
+ return AMD_NOTI_CONTINUE;
+
+ ctx = __find_proc_context(pid);
+ if (ctx == NULL) {
+ _E("Failed to find proc status. pid(%d)", pid);
+ return AMD_NOTI_CONTINUE;
}
+ ret = __send_request(ctx, WATCHDOG_ENABLE, __watchdog.interval);
+ _W("pid(%d), result(%d)", pid, ret);
+
+ __watchdog_set_timer(ctx);
+ ctx->watchdog_enable = true;
+ _watchdog_logger_print("ENABLE", "pid(%d)", pid);
+
return AMD_NOTI_CONTINUE;
}
amd_noti_listen(AMD_NOTI_MSG_APP_STATUS_ADD,
__on_app_status_add);
+ amd_noti_listen(AMD_NOTI_MSG_APP_STATUS_APP_START,
+ __on_app_status_app_start);
amd_noti_listen(AMD_NOTI_MSG_APP_STATUS_CLEANUP,
__on_app_status_cleanup);
amd_noti_listen(AMD_NOTI_MSG_SIGNAL_SEND_WATCHDOG_START,