From 2a6f7385459e4461287c8f8c43e8cba9ccae8a27 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 19 Aug 2019 10:25:59 +0900 Subject: [PATCH] Add a new enumeration for component status Adds: - comp_status_e Change-Id: I891f17988e6e54dc15eab8361fdb9271ac9321b4 Signed-off-by: Hwankyu Jhun --- CMakeLists.txt | 1 + include/aul_comp_context.h | 5 ++++- include/aul_comp_status.h | 3 +++ include/aul_comp_types.h | 38 ++++++++++++++++++++++++++++++++++++++ tool/compmgr_tool.c | 24 ++++++++++++------------ 5 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 include/aul_comp_types.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 05b1571..fcc7dee 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,7 @@ SET(HEADERS_LIB_AUL aul_comp_context.h aul_comp_info_internal.h aul_watch_control.h + aul_comp_types.h ) # Install headers, other files diff --git a/include/aul_comp_context.h b/include/aul_comp_context.h index 4c76958..1528449 100644 --- a/include/aul_comp_context.h +++ b/include/aul_comp_context.h @@ -19,7 +19,8 @@ #include #include -#include "aul.h" +#include +#include #ifdef __cplusplus extern "C" { @@ -141,6 +142,8 @@ int aul_comp_context_get_pid(aul_comp_context_h handle, pid_t *pid); * @return @c 0 on success, * otherwise a negative error value * + * @see comp_status_e + * * @remarks This function is only for App Framework internally. */ int aul_comp_context_get_status(aul_comp_context_h handle, int *status); diff --git a/include/aul_comp_status.h b/include/aul_comp_status.h index 2b1ed7a..4c90c4e 100644 --- a/include/aul_comp_status.h +++ b/include/aul_comp_status.h @@ -16,6 +16,9 @@ #pragma once +#include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/include/aul_comp_types.h b/include/aul_comp_types.h new file mode 100644 index 0000000..6255bff --- /dev/null +++ b/include/aul_comp_types.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumeration for component status. + * @since_tizen 5.5 + */ +typedef enum { + COMP_STATUS_INITIALIZED, /**< Initialized status */ + COMP_STATUS_CREATED, /**< Created status */ + COMP_STATUS_STARTED, /**< Started status */ + COMP_STATUS_RESUMED, /**< Resumed status */ + COMP_STATUS_PAUSED, /**< Paused status */ + COMP_STATUS_DESTROYED, /**< Destroyed status */ +} comp_status_e; + +#ifdef __cplusplus +} +#endif diff --git a/tool/compmgr_tool.c b/tool/compmgr_tool.c index 03b2a74..84e497c 100644 --- a/tool/compmgr_tool.c +++ b/tool/compmgr_tool.c @@ -300,18 +300,18 @@ static int __cmd_list_run(void *data) static const char *__get_status_string(int status) { switch (status) { - case STATUS_LAUNCHING: - return "STATUS_LAUNCHING"; - case STATUS_CREATED: - return "STATUS_CREATED"; - case STATUS_FOCUS: - return "STATUS_FOCUS"; - case STATUS_VISIBLE: - return "STATUS_VISIBLE"; - case STATUS_BG: - return "STATUS_BG"; - case STATUS_DYING: - return "STATUS_DYING"; + case COMP_STATUS_INITIALIZED: + return "COMP_STATUS_INITIALIZED"; + case COMP_STATUS_CREATED: + return "COMP_STATUS_CREATED"; + case COMP_STATUS_STARTED: + return "COMP_STATUS_STARTED"; + case COMP_STATUS_RESUMED: + return "COMP_STATUS_RESUMED"; + case COMP_STATUS_PAUSED: + return "COMP_STATUS_PAUSED"; + case COMP_STATUS_DESTROYED: + return "COMP_STATUS_DESTROYED"; default: return "Unknown Status"; } -- 2.7.4