From fb57cec2551540af9d9473f5957e97885826e18d Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 15 Jul 2019 14:01:05 +0900 Subject: [PATCH 01/16] Release version 0.1.6 Changes: - Make a gcov package for measuring coverage easier Change-Id: I9339f1b3cb77aec1b8ce2d3290a8c0e78576bc76 Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index 4d92fe1..6c42b4e 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.5 +Version: 0.1.6 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4 From 063d6881189363aa9bca4505449cd434f8785c1a Mon Sep 17 00:00:00 2001 From: "SukHyung, Kang" Date: Wed, 13 Nov 2019 14:29:36 +0900 Subject: [PATCH 02/16] Fix api reference for job scheduler Change-Id: If5d199e51e7566fd04b6efad5e7ba9e846fc0166 Signed-off-by: SukHyung, Kang --- include/job_scheduler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/job_scheduler.h b/include/job_scheduler.h index ff3ae46..796cbf6 100644 --- a/include/job_scheduler.h +++ b/include/job_scheduler.h @@ -213,7 +213,7 @@ int job_scheduler_foreach_job(job_scheduler_foreach_job_cb callback, void *user_ * @see job_scheduler_service_remove() * @see job_service_start_cb() * @see job_service_stop_cb() - * @see job_scheduler_job_finished() + * @see job_scheduler_notify_job_finished() * @see #job_service_callback_s */ int job_scheduler_service_add(const char *job_id, job_service_callback_s *callback, void *user_data, job_service_h *job_service); -- 2.7.4 From cfb1a3bff8a4d942eadbafa44306f4c9a80a3df6 Mon Sep 17 00:00:00 2001 From: "SukHyung, Kang" Date: Thu, 14 Nov 2019 16:42:02 +0900 Subject: [PATCH 03/16] Release version 0.1.7 Changes: - Fix api reference for job scheduler Change-Id: I68098fab4ecf1967e87e9eec0083e04ff97acb22 Signed-off-by: SukHyung, Kang --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index 6c42b4e..b2f229e 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.6 +Version: 0.1.7 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4 From a1ea91dd2e3d7c65f28d24dea6b082ad3fcdc27a Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Fri, 6 Dec 2019 16:56:48 +0900 Subject: [PATCH 04/16] Update doc file for new link Change-Id: I25a7829e96771cba617525019e3724f5f199c7ec Signed-off-by: Inkyun Kil --- doc/appfw_job_scheduler_doc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/appfw_job_scheduler_doc.h b/doc/appfw_job_scheduler_doc.h index d0ee39b..5fb0011 100755 --- a/doc/appfw_job_scheduler_doc.h +++ b/doc/appfw_job_scheduler_doc.h @@ -38,7 +38,7 @@ * It is recommended to use features in your application for reliability. * You can check if the device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, and control your application's actions accordingly. * To ensure your application is only running on devices with specific features, please define the features in your manifest file using the manifest editor in the SDK. - * More details on using features in your application can be found in Feature Element. + * More details on using features in your application can be found in Feature Element. */ #endif /* __TIZEN_APPFW_JOB_SCHEDULER_DOC_H__ */ -- 2.7.4 From 3125dee2970e00a3dc8c2cb25c0e13debe013c0a Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 9 Jun 2020 08:02:06 +0900 Subject: [PATCH 05/16] Release version 0.1.8 Changes: - Update doc file for new link Change-Id: I889dad179db8f73728a4d257924d85d11d6dcadc Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index b2f229e..1200908 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.7 +Version: 0.1.8 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4 From 851c6ce1b086044d0c078a322ac7f5bbe42cd940 Mon Sep 17 00:00:00 2001 From: "SukHyung, Kang" Date: Tue, 6 Oct 2020 09:48:33 +0900 Subject: [PATCH 06/16] Change documentation for job scheduler Change-Id: Ibecd19c1f4c19e71fa1476d4bba17b71dcf3ddea Signed-off-by: SukHyung, Kang --- doc/appfw_job_scheduler_doc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/appfw_job_scheduler_doc.h b/doc/appfw_job_scheduler_doc.h index 5fb0011..db47e7c 100755 --- a/doc/appfw_job_scheduler_doc.h +++ b/doc/appfw_job_scheduler_doc.h @@ -38,7 +38,7 @@ * It is recommended to use features in your application for reliability. * You can check if the device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, and control your application's actions accordingly. * To ensure your application is only running on devices with specific features, please define the features in your manifest file using the manifest editor in the SDK. - * More details on using features in your application can be found in Feature Element. + * More details on featuring your application can be found from Feature Element. */ #endif /* __TIZEN_APPFW_JOB_SCHEDULER_DOC_H__ */ -- 2.7.4 From f418f08480b3e14de7a1ee94ba5f7b02e826470e Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 16 Dec 2020 14:56:26 +0900 Subject: [PATCH 07/16] Fix doc - Removes unnecessary HTML link for feature Change-Id: I243b0fc32352ef0d79224d2c1f5943a4f5a77bc0 Signed-off-by: Hwankyu Jhun --- doc/appfw_job_scheduler_doc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/appfw_job_scheduler_doc.h b/doc/appfw_job_scheduler_doc.h index db47e7c..d98f761 100755 --- a/doc/appfw_job_scheduler_doc.h +++ b/doc/appfw_job_scheduler_doc.h @@ -30,10 +30,10 @@ * * @section CAPI_JOB_SCHEDULER_MODULE_FEATURE Related Features * Some job trigger events and some functions are related with the following features: - * - http://tizen.org/feature/network.wifi - * - http://tizen.org/feature/location.gps - * - http://tizen.org/feature/battery - * - http://tizen.org/feature/usb.host + * - %http://tizen.org/feature/network.wifi + * - %http://tizen.org/feature/location.gps + * - %http://tizen.org/feature/battery + * - %http://tizen.org/feature/usb.host * * It is recommended to use features in your application for reliability. * You can check if the device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, and control your application's actions accordingly. -- 2.7.4 From 726950b8d330a1722447067ca3c5ff4ebb305084 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 16 Dec 2020 14:58:31 +0900 Subject: [PATCH 08/16] Release version 0.1.9 Changes: - Change documentation for job scheduler - Fix doc Change-Id: I50b29fadd2ca5933aa4d4b8a20291c3adb3b76f9 Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index 1200908..d60feda 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.8 +Version: 0.1.9 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4 From 50958698f8097ebe8d3d6f0c63e92e3740e53ad0 Mon Sep 17 00:00:00 2001 From: "SukHyung, Kang" Date: Tue, 22 Dec 2020 17:35:28 +0900 Subject: [PATCH 09/16] Fix link for job scheduler doc Change-Id: I242051f07f6fad3020f59dfbb726f0eaa6216536 Signed-off-by: SukHyung, Kang --- include/job_info.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/job_info.h b/include/job_info.h index 84e0eee..38f9221 100644 --- a/include/job_info.h +++ b/include/job_info.h @@ -51,9 +51,9 @@ typedef enum { JOB_TRIGGER_EVENT_POWERSAVE_MODE_DISABLED, /**< The Power-saving mode: Disabled */ JOB_TRIGGER_EVENT_USB_STATE_CONNECTED, /**< The USB state: Connected */ JOB_TRIGGER_EVENT_USB_STATE_DISCONNECTED, /**< The USB state: Disconnected */ - JOB_TRIGGER_EVENT_WIFI_STATE_DISABLED, /**< The WiFi state: Disabled @n Privilege: http://tizen.org/privilege/network.get */ - JOB_TRIGGER_EVENT_WIFI_STATE_DISCONNECTED, /**< The WiFi state: Disconnected @n Privilege: http://tizen.org/privilege/network.get */ - JOB_TRIGGER_EVENT_WIFI_STATE_CONNECTED, /**< The WiFi state: Connected @n Privilege: http://tizen.org/privilege/network.get */ + JOB_TRIGGER_EVENT_WIFI_STATE_DISABLED, /**< The WiFi state: Disabled @n Privilege: %http://tizen.org/privilege/network.get */ + JOB_TRIGGER_EVENT_WIFI_STATE_DISCONNECTED, /**< The WiFi state: Disconnected @n Privilege: %http://tizen.org/privilege/network.get */ + JOB_TRIGGER_EVENT_WIFI_STATE_CONNECTED, /**< The WiFi state: Connected @n Privilege: %http://tizen.org/privilege/network.get */ } job_trigger_event_e; /** @@ -214,7 +214,7 @@ int job_info_set_requires_wifi_connection(job_info_h job_info, bool wifi_connect * @remarks The periodic interval of the job info handle must be 0. * If the interval of the job info handle is not 0, this function returns a negative error value. * Regarding the @a event, the application may require the following privilege: - * http://tizen.org/privilege/network.get @n + * %http://tizen.org/privilege/network.get @n * If the application does not have the necessary privilege, this function returns #JOB_ERROR_PERMISSION_DENIED. * See #job_trigger_event_e to find the corresponding privilege of each event. * @param[in] job_info The job info handle -- 2.7.4 From 32de9a1c775422b7356b6ac6e6a6898b6486cfaf Mon Sep 17 00:00:00 2001 From: "SukHyung, Kang" Date: Wed, 23 Dec 2020 16:15:37 +0900 Subject: [PATCH 10/16] Release version 0.1.10 Changes: - Fix link for job scheduler doc Change-Id: I5e9172a133dcfbd4c80101d0dbbe917bba22c477 Signed-off-by: SukHyung, Kang --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index d60feda..29b2ec5 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.9 +Version: 0.1.10 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4 From ce6f6b7911af38a33534cb2742467b5322cc9e17 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 20 Jan 2022 14:32:59 +0900 Subject: [PATCH 11/16] Fix installation path of gcov result Change-Id: Ie79df72d4993f89dff52577614c269747022d219 Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index 29b2ec5..513b8a5 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -71,8 +71,8 @@ rm -rf %{buildroot} %make_install %if 0%{?gcov:1} -mkdir -p %{buildroot}%{_datadir}/gcov/obj -install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name} +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name} %endif %post -p /sbin/ldconfig -- 2.7.4 From 1f4617b07274fcea32b0c4989a31ac972e39c219 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 20 Jan 2022 15:08:26 +0900 Subject: [PATCH 12/16] Release version 0.1.11 Changes: - Fix installation path of gcov result Change-Id: I981d25087820d0cf7bcd9fd31ef747e7e3a0fd0f Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index 513b8a5..faba34a 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.10 +Version: 0.1.11 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4 From 07c1f6c58ab0bab8449dab2fbd4052f15e02da39 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 7 Feb 2023 02:03:20 +0000 Subject: [PATCH 13/16] Fix gcov installation path The path should be "/usr/share/gcov/obj//". Change-Id: Ib9b3303951b2f3050ec4f4d6aec01b33f777f8a7 Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index faba34a..b0b0ff3 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -71,8 +71,10 @@ rm -rf %{buildroot} %make_install %if 0%{?gcov:1} -mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name} -install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name} +builddir=$(basename $PWD) +gcno_obj_dir=%{buildroot}%{_datadir}/gcov/obj/%{name}/"$builddir" +mkdir -p "$gcno_obj_dir" +find . -name '*.gcno' -exec cp --parents '{}' "$gcno_obj_dir" ';' %endif %post -p /sbin/ldconfig @@ -91,5 +93,5 @@ install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name} %if 0%{?gcov:1} %files gcov -%{_datadir}/gcov/obj/* +%{_datadir}/gcov/* %endif -- 2.7.4 From fc706a3c24e627d3b8f60b9e7ba9672e62462cab Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 7 Feb 2023 02:14:03 +0000 Subject: [PATCH 14/16] Release version 0.1.12 Changes: - Fix gcov installation path Change-Id: Ia14e53fd103a28c3255caf0e0e917312d191f922 Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index b0b0ff3..f95f3f6 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.11 +Version: 0.1.12 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4 From 94c77549d50a6c4bc0abd2388008aca50ad06171 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 29 Aug 2023 12:31:41 +0900 Subject: [PATCH 15/16] Adjust line exclusion from code coverage Tizen uses RPI4 device for Common(IoT) profile. The functions are not worked propelry. Because, this feature is for mobile and wearable profile. This API will be deprecated. Change-Id: Ia48135652c6ad7a16bf7c727faf5bec4c8054e12 Signed-off-by: Hwankyu Jhun --- CMakeLists.txt | 4 ++- src/CMakeLists.txt | 2 +- src/job_error.c | 10 +++---- src/job_info.c | 28 +++++++++--------- src/job_scheduler.c | 81 +++++++++++++++++++++++------------------------------ 5 files changed, 58 insertions(+), 67 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 085faf4..2ce8011 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) + +PROJECT(capi-appfw-job-scheduler) SET(INC_DIR include) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a03f03e..9b721ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) SET(fw_name "capi-appfw-job-scheduler") PROJECT(${fw_name}) diff --git a/src/job_error.c b/src/job_error.c index f3661cb..0c700c9 100644 --- a/src/job_error.c +++ b/src/job_error.c @@ -30,9 +30,9 @@ static const char *__job_error_to_string(job_error_e error) return "None"; case JOB_ERROR_INVALID_PARAMETER: return "Invalid parameter"; - case JOB_ERROR_OUT_OF_MEMORY: - return "Out of memory"; /* LCOV_EXCL_LINE */ - case JOB_ERROR_IO_ERROR: + case JOB_ERROR_OUT_OF_MEMORY: /* LCOV_EXCL_LINE */ + return "Out of memory"; /* LCOV_EXCL_LINE */ + case JOB_ERROR_IO_ERROR: /* LCOV_EXCL_LINE */ return "IO error"; /* LCOV_EXCL_LINE */ case JOB_ERROR_NOT_INITIALIZED: return "Not initialized"; @@ -40,9 +40,9 @@ static const char *__job_error_to_string(job_error_e error) return "No such job"; case JOB_ERROR_ALREADY_EXIST: return "Already exist"; - case JOB_ERROR_PERMISSION_DENIED: + case JOB_ERROR_PERMISSION_DENIED: /* LCOV_EXCL_LINE */ return "Permission denied"; /* LCOV_EXCL_LINE */ - default: + default: /* LCOV_EXCL_LINE */ return "Unknown"; /* LCOV_EXCL_LINE */ } } diff --git a/src/job_info.c b/src/job_info.c index 534e39c..8699e2f 100644 --- a/src/job_info.c +++ b/src/job_info.c @@ -254,9 +254,9 @@ API int job_info_set_requires_battery_not_low(job_info_h job_info, if (r != JOB_ERROR_NONE) return job_error(r, __FUNCTION__, __LINE__, NULL); - job_info->battery_not_low = battery_not_low; + job_info->battery_not_low = battery_not_low; /* LCOV_EXCL_LINE */ - return JOB_ERROR_NONE; + return JOB_ERROR_NONE; /* LCOV_EXCL_LINE */ } int job_info_is_requires_battery_not_low(job_info_h job_info, @@ -287,9 +287,9 @@ API int job_info_set_requires_charging(job_info_h job_info, bool charging) if (r != JOB_ERROR_NONE) return job_error(r, __FUNCTION__, __LINE__, NULL); - job_info->charging = charging; + job_info->charging = charging; /* LCOV_EXCL_LINE */ - return JOB_ERROR_NONE; + return JOB_ERROR_NONE; /* LCOV_EXCL_LINE */ } int job_info_is_requires_charging(job_info_h job_info, int *charging) @@ -415,14 +415,14 @@ API int job_info_clone(job_info_h job_info, job_info_h *clone) } if (job_info->job_id) { + /* LCOV_EXCL_START */ info->job_id = strdup(job_info->job_id); if (info->job_id == NULL) { - /* LCOV_EXCL_START */ free(info); return job_error(JOB_ERROR_OUT_OF_MEMORY, __FUNCTION__, __LINE__, NULL); - /* LCOV_EXCL_STOP */ } + /* LCOV_EXCL_STOP */ } info->interval = job_info->interval; @@ -441,19 +441,19 @@ API int job_info_clone(job_info_h job_info, job_info_h *clone) return JOB_ERROR_NONE; } +/* LCOV_EXCL_START */ int job_info_get_trigger_list(job_info_h job_info, bool **trigger_list) { if (job_info == NULL || trigger_list == NULL) { - /* LCOV_EXCL_START */ return job_error(JOB_ERROR_INVALID_PARAMETER, __FUNCTION__, __LINE__, NULL); - /* LCOV_EXCL_STOP */ } *trigger_list = job_info->trigger_list; return JOB_ERROR_NONE; } +/* LCOV_EXCL_STOP */ int job_info_set_job_id(job_info_h job_info, const char *job_id) { @@ -499,9 +499,9 @@ API int job_info_get_job_id(job_info_h job_info, char **job_id) static void __set_requires_value(const char *str, int *value) { if (str && strcmp(str, "true") == 0) - *value = true; + *value = true; /* LCOV_EXCL_LINE */ else if (str && strcmp(str, "false") == 0) - *value = false; + *value = false; /* LCOV_EXCL_LINE */ else *value = -1; } @@ -561,15 +561,15 @@ static void __set_job_info(job_info_h job_info, bundle *b) val = bundle_get_val(b, AUL_K_JOB_PERSISTENT); if (val) - job_info->persistent = true; + job_info->persistent = true; /* LCOV_EXCL_LINE */ val = bundle_get_val(b, AUL_K_JOB_IS_ONCE); if (val) - job_info->once = true; + job_info->once = true; /* LCOV_EXCL_LINE */ val = bundle_get_val(b, AUL_K_JOB_REQ_TIMEOUT); if (val && isdigit(*val)) - job_info->timeout = strtoul(val, NULL, 10); + job_info->timeout = strtoul(val, NULL, 10); /* LCOV_EXCL_LINE */ val = bundle_get_val(b, AUL_K_JOB_REQ_BATTERY_NOT_LOW); __set_requires_value(val, &job_info->battery_not_low); @@ -583,7 +583,7 @@ static void __set_job_info(job_info_h job_info, bundle *b) for (i = 0; i < ARRAY_SIZE(key_list); ++i) { val = bundle_get_val(b, key_list[i]); if (val) - job_info->trigger_list[i] = true; + job_info->trigger_list[i] = true; /* LCOV_EXCL_LINE */ } } diff --git a/src/job_scheduler.c b/src/job_scheduler.c index c67feac..7071a69 100644 --- a/src/job_scheduler.c +++ b/src/job_scheduler.c @@ -246,8 +246,10 @@ static bundle *__get_bundle_from_job(ctx_sched_job_h job) r = ctx_sched_job_get_user_data(job, (char **)&b_raw, &len); if (r != 0) { + /* LCOV_EXCL_START */ _E("Failed to get user data"); return NULL; + /* LCOV_EXCL_STOP */ } b = bundle_decode(b_raw, len); @@ -259,6 +261,7 @@ static bundle *__get_bundle_from_job(ctx_sched_job_h job) return b; } +/* LCOV_EXCL_START */ static void __add_job(ctx_sched_job_h job) { bundle *b = NULL; @@ -314,19 +317,15 @@ static void __start_job_cb(ctx_sched_h scheduler, ctx_sched_job_h job, b = __get_bundle_from_job(job); if (b == NULL) { - /* LCOV_EXCL_START */ ctx_sched_job_destroy(job); return; - /* LCOV_EXCL_STOP */ } job_id = bundle_get_val(b, AUL_K_JOB_ID); if (job_id == NULL) { - /* LCOV_EXCL_START */ ctx_sched_job_destroy(job); bundle_free(b); return; - /* LCOV_EXCL_STOP */ } if (!g_hash_table_contains(__handle.job_id_table, job_id)) @@ -347,25 +346,22 @@ static void __stop_job_cb(ctx_sched_h scheduler, ctx_sched_job_h job, b = __get_bundle_from_job(job); if (b == NULL) { - /* LCOV_EXCL_START */ ctx_sched_job_destroy(job); return; - /* LCOV_EXCL_STOP */ } job_id = bundle_get_val(b, AUL_K_JOB_ID); if (job_id == NULL) { - /* LCOV_EXCL_START */ ctx_sched_job_destroy(job); bundle_free(b); return; - /* LCOV_EXCL_STOP */ } service_app_job_raise(SERVICE_APP_JOB_STATUS_STOP, job_id, b); ctx_sched_job_destroy(job); bundle_free(b); } +/* LCOV_EXCL_STOP */ static int __init_scheduler(ctx_sched_h *scheduler) { @@ -514,8 +510,10 @@ static int __job_add_user_data(ctx_sched_job_h job, job_info_h job_info, r = bundle_encode(b, &b_raw, &len); if (r != BUNDLE_ERROR_NONE) { + /* LCOV_EXCL_START */ _E("Failed to encode bundle"); return JOB_ERROR_IO_ERROR; + /* LCOV_EXCL_STOP */ } r = ctx_sched_job_set_user_data(job, (const char *)b_raw, len); @@ -554,8 +552,10 @@ static bool __exist_job(const char *job_id) r = ctx_sched_get_job(__handle.scheduler, id, &job); if (r != 0) { + /* LCOV_EXCL_START */ g_hash_table_remove(__handle.job_id_table, job_id); return false; + /* LCOV_EXCL_STOP */ } ctx_sched_job_destroy(job); @@ -583,7 +583,7 @@ static int __job_add_persistent(ctx_sched_job_h job, job_info_h job_info, } if (persistent) - bundle_add(b, AUL_K_JOB_PERSISTENT, "true"); + bundle_add(b, AUL_K_JOB_PERSISTENT, "true"); /* LCOV_EXCL_LINE */ return JOB_ERROR_NONE; } @@ -608,7 +608,7 @@ static int __job_add_one_time(ctx_sched_job_h job, job_info_h job_info, } if (once) - bundle_add(b, AUL_K_JOB_IS_ONCE, "true"); + bundle_add(b, AUL_K_JOB_IS_ONCE, "true"); /* LCOV_EXCL_LINE */ return JOB_ERROR_NONE; } @@ -634,13 +634,16 @@ static int __job_add_requirement_timeout(ctx_sched_job_h job, } if (timeout) { + /* LCOV_EXCL_START */ snprintf(buf, sizeof(buf), "%u", timeout); bundle_add(b, AUL_K_JOB_REQ_TIMEOUT, buf); + /* LCOV_EXCL_STOP */ } return JOB_ERROR_NONE; } +/* LCOV_EXCL_START */ static int __add_str_attr_ne(ctx_sched_job_context_h context, const char *name, const char *value) { @@ -648,18 +651,14 @@ static int __add_str_attr_ne(ctx_sched_job_context_h context, r = ctx_sched_job_context_prepare_attribute_str(context, name); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to prepare string attribute(%s) - %d", name, r); return r; - /* LCOV_EXCL_STOP */ } r = ctx_sched_job_context_attribute_add_ne_str(context, name, value); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to add string value(%s) - %d", value, r); return r; - /* LCOV_EXCL_STOP */ } return JOB_ERROR_NONE; @@ -672,18 +671,14 @@ static int __add_str_attr_eq(ctx_sched_job_context_h context, r = ctx_sched_job_context_prepare_attribute_str(context, name); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to prepare string attribute(%s) - %d", name, r); return r; - /* LCOV_EXCL_STOP */ } r = ctx_sched_job_context_attribute_add_eq_str(context, name, value); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to add string value(%s) - %d", value, r); return r; - /* LCOV_EXCL_STOP */ } return JOB_ERROR_NONE; @@ -696,22 +691,19 @@ static int __add_int_attr_eq(ctx_sched_job_context_h context, r = ctx_sched_job_context_prepare_attribute_int(context, name); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to prepare integer attribute(%s) - %d", name, r); return r; - /* LCOV_EXCL_STOP */ } r = ctx_sched_job_context_attribute_add_eq_int(context, name, value); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to add integer value(%d) - %d", value, r); return r; - /* LCOV_EXCL_STOP */ } return JOB_ERROR_NONE; } +/* LCOV_EXCL_STOP */ static int __job_add_requires_battery_not_low(ctx_sched_job_h job, job_info_h job_info, void *data) @@ -728,13 +720,12 @@ static int __job_add_requires_battery_not_low(ctx_sched_job_h job, if (battery_not_low == -1) return JOB_ERROR_NONE; + /* LCOV_EXCL_START */ r = ctx_sched_job_requirement_create(CTX_SCHED_URI_BATTERY, false, &requirement); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to create requirement (%d)", r); return r; - /* LCOV_EXCL_STOP */ } if (battery_not_low) { @@ -744,20 +735,17 @@ static int __job_add_requires_battery_not_low(ctx_sched_job_h job, r = __add_str_attr_ne(requirement, CTX_SCHED_ATTR_NAME_LEVEL, CTX_SCHED_ATTR_VALUE_HIGH); } + if (r != JOB_ERROR_NONE) { - /* LCOV_EXCL_START */ ctx_sched_job_context_destroy(requirement); return r; - /* LCOV_EXCL_STOP */ } r = ctx_sched_job_add_requirement(job, requirement); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to add requirement (%d)", r); ctx_sched_job_context_destroy(requirement); return r; - /* LCOV_EXCL_STOP */ } if (battery_not_low) @@ -766,6 +754,7 @@ static int __job_add_requires_battery_not_low(ctx_sched_job_h job, bundle_add(b, AUL_K_JOB_REQ_BATTERY_NOT_LOW, "false"); return JOB_ERROR_NONE; + /* LCOV_EXCL_STOP */ } static int __job_add_requires_charging(ctx_sched_job_h job, @@ -783,31 +772,26 @@ static int __job_add_requires_charging(ctx_sched_job_h job, if (charging == -1) return JOB_ERROR_NONE; + /* LCOV_EXCL_START */ r = ctx_sched_job_requirement_create(CTX_SCHED_URI_BATTERY, false, &requirement); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to create requirement (%d)", r); return r; - /* LCOV_EXCL_STOP */ } r = __add_int_attr_eq(requirement, CTX_SCHED_ATTR_NAME_IS_CHARGING, charging); if (r != JOB_ERROR_NONE) { - /* LCOV_EXCL_START */ ctx_sched_job_context_destroy(requirement); return r; - /* LCOV_EXCL_STOP */ } r = ctx_sched_job_add_requirement(job, requirement); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to add requirement (%d)", r); ctx_sched_job_context_destroy(requirement); return r; - /* LCOV_EXCL_STOP */ } if (charging) @@ -816,6 +800,7 @@ static int __job_add_requires_charging(ctx_sched_job_h job, bundle_add(b, AUL_K_JOB_REQ_CHARGING, "false"); return JOB_ERROR_NONE; + /* LCOV_EXCL_STOP */ } static int __job_add_requires_wifi_connection(ctx_sched_job_h job, @@ -833,13 +818,12 @@ static int __job_add_requires_wifi_connection(ctx_sched_job_h job, if (wifi_connection == -1) return JOB_ERROR_NONE; + /* LCOV_EXCL_START */ r = ctx_sched_job_requirement_create(CTX_SCHED_URI_WIFI, false, &requirement); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to create requirement (%d)", r); return r; - /* LCOV_EXCL_STOP */ } if (wifi_connection) { @@ -849,20 +833,17 @@ static int __job_add_requires_wifi_connection(ctx_sched_job_h job, r = __add_str_attr_ne(requirement, CTX_SCHED_ATTR_NAME_STATE, CTX_SCHED_ATTR_VALUE_CONNECTED); } + if (r != JOB_ERROR_NONE) { - /* LCOV_EXCL_START */ ctx_sched_job_context_destroy(requirement); return r; - /* LCOV_EXCL_STOP */ } r = ctx_sched_job_add_requirement(job, requirement); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to add requirement (%d)", r); ctx_sched_job_context_destroy(requirement); return r; - /* LCOV_EXCL_STOP */ } if (wifi_connection) @@ -871,8 +852,10 @@ static int __job_add_requires_wifi_connection(ctx_sched_job_h job, bundle_add(b, AUL_K_JOB_REQ_WIFI_CONNECTION, "false"); return JOB_ERROR_NONE; + /* LCOV_EXCL_STOP */ } +/* LCOV_EXCL_START */ static int __add_trigger_event(ctx_sched_job_h job, job_trigger_event_e event, bundle *b) { @@ -882,10 +865,8 @@ static int __add_trigger_event(ctx_sched_job_h job, job_trigger_event_e event, r = ctx_sched_job_trigger_create(job_trigger_map[event].uri, &trigger); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to create trigger (%d)", r); return r; - /* LCOV_EXCL_STOP */ } if (job_trigger_map[event].attr_type == ATTR_TYPE_INTEGER) { @@ -902,17 +883,16 @@ static int __add_trigger_event(ctx_sched_job_h job, job_trigger_event_e event, r = ctx_sched_job_add_trigger(job, trigger); if (r != 0) { - /* LCOV_EXCL_START */ _E("Failed to add trigger (%d)", r); ctx_sched_job_context_destroy(trigger); return r; - /* LCOV_EXCL_STOP */ } bundle_add(b, job_trigger_map[event].key, "true"); return JOB_ERROR_NONE; } +/* LCOV_EXCL_STOP */ static int __job_add_trigger_events(ctx_sched_job_h job, job_info_h job_info, void *data) @@ -927,6 +907,7 @@ static int __job_add_trigger_events(ctx_sched_job_h job, if (interval != 0) return JOB_ERROR_NONE; + /* LCOV_EXCL_START */ r = job_info_get_trigger_list(job_info, &trigger_list); if (r != JOB_ERROR_NONE) return r; @@ -941,6 +922,7 @@ static int __job_add_trigger_events(ctx_sched_job_h job, } return JOB_ERROR_NONE; + /* LCOV_EXCL_STOP */ } static job_add_cb job_constructor[] = { @@ -983,7 +965,7 @@ static ctx_sched_job_h __create_job(job_info_h job_info, const char *job_id) job_info_get_periodic(job_info, &interval); if (interval == 0) { - r = ctx_sched_job_create_on_demand(&job); + r = ctx_sched_job_create_on_demand(&job); /* LCOV_EXCL_LINE */ } else { snprintf(buf, sizeof(buf), "%u", interval); bundle_add(b, AUL_K_JOB_PERIODIC, buf); @@ -1252,6 +1234,7 @@ API int job_scheduler_foreach_job(job_scheduler_foreach_job_cb callback, return JOB_ERROR_NONE; } +/* LCOV_EXCL_START*/ static int __job_service_cb(int event, const char *job_id, bundle *job_data, void *user_data) { @@ -1278,6 +1261,7 @@ static int __job_service_cb(int event, const char *job_id, bundle *job_data, return 0; } +/* LCOV_EXCL_STOP */ static struct job_service_s *__create_job_service(const char *job_id, job_service_callback_s *callback, void *user_data) @@ -1390,8 +1374,10 @@ int job_scheduler_verify_requirement(const char *uri) int r; if (uri == NULL) { + /* LCOV_EXCL_START */ return job_error(JOB_ERROR_INVALID_PARAMETER, __FUNCTION__, __LINE__, NULL); + /* LCOV_EXCL_STOP */ } if (!__handle.initialized) { @@ -1424,8 +1410,10 @@ int job_scheduler_verify_trigger(const char *uri) int r; if (uri == NULL) { + /* LCOV_EXCL_START */ return job_error(JOB_ERROR_INVALID_PARAMETER, __FUNCTION__, __LINE__, NULL); + /* LCOV_EXCL_STOP */ } if (!__handle.initialized) { @@ -1516,8 +1504,9 @@ static int __init_cynara(void) _I("Cynara initialized"); return 0; -err: + /* LCOV_EXCL_START */ +err: if (conf) cynara_configuration_destroy(conf); -- 2.7.4 From de39522f422d74084a468d30432393e4cfeca424 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 29 Aug 2023 13:48:00 +0900 Subject: [PATCH 16/16] Release version 0.1.13 Changes: - Adjust line exclusion from code coverage Change-Id: Ied502336c2c9f9c55826db0976fc81fb4fc25918 Signed-off-by: Hwankyu Jhun --- packaging/capi-appfw-job-scheduler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-appfw-job-scheduler.spec b/packaging/capi-appfw-job-scheduler.spec index f95f3f6..9908e0c 100644 --- a/packaging/capi-appfw-job-scheduler.spec +++ b/packaging/capi-appfw-job-scheduler.spec @@ -1,6 +1,6 @@ Name: capi-appfw-job-scheduler Summary: Job Scheduler library -Version: 0.1.12 +Version: 0.1.13 Release: 0 Group: System/API License: Apache-2.0 -- 2.7.4