Add missing function call 84/305484/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 2 Feb 2024 06:52:10 +0000 (15:52 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 2 Feb 2024 06:52:10 +0000 (15:52 +0900)
To use AppControlAction API, the Init() method must be called.

Change-Id: Ieed41a2e529ffdcdf84662c2464d537607981147
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
tizen-cpp/app-core-cpp/api/app_core_base_control.cc

index 263be6d..738f2ce 100644 (file)
@@ -29,6 +29,8 @@ API int app_core_base_control_add(const char* id, app_core_base_control_cb cb,
     return -EINVAL;
   }
 
+  if (tizen_cpp::AppControlManager::Init() != 0) return -EIO;
+
   return tizen_cpp::AppControlManager::Add(
       id, [=](bundle* b) { cb(b, user_data); },
       reinterpret_cast<tizen_cpp::AppControlAction**>(h));
@@ -40,6 +42,8 @@ API int app_core_base_control_remove(app_core_base_control_h h) {
     return -EINVAL;
   }
 
+  if (tizen_cpp::AppControlManager::Init() != 0) return -EIO;
+
   return tizen_cpp::AppControlManager::Remove(
       reinterpret_cast<tizen_cpp::AppControlAction*>(h));
 }