change to check widget feature first 11/300111/2
authorSukhyungKang <shine.kang@samsung.com>
Tue, 17 Oct 2023 01:52:46 +0000 (10:52 +0900)
committerSukhyungKang <shine.kang@samsung.com>
Tue, 17 Oct 2023 01:55:17 +0000 (10:55 +0900)
when the widget feature is disabled, widget is not supported error
should be returned before other errors.

Change-Id: I608841a23c822d6597a49026b885aed2d5f617dc
Signed-off-by: SukhyungKang <shine.kang@samsung.com>
src/widget_service.c

index 64680ad..bc8700e 100644 (file)
@@ -2987,16 +2987,18 @@ static int __disable_cb(const char *endpoint, aul_app_com_result_e e,
 EAPI int widget_service_set_disable_event_cb(widget_disable_event_cb callback,
                void *user_data)
 {
-       if (callback == NULL) {
-               _E("invalid parameter");
-               return WIDGET_ERROR_INVALID_PARAMETER;
-       }
-/* LCOV_EXCL_START */
+       /* LCOV_EXCL_START */
        if (!_is_widget_feature_enabled()) {
                _E("Not supported");
                return WIDGET_ERROR_NOT_SUPPORTED;
        }
-/* LCOV_EXCL_STOP */
+       /* LCOV_EXCL_STOP */
+
+       if (callback == NULL) {
+               _E("invalid parameter");
+               return WIDGET_ERROR_INVALID_PARAMETER;
+       }
+
        if (check_privilege("http://tizen.org/privilege/widget.viewer") < 0)
                return WIDGET_ERROR_PERMISSION_DENIED;