Add new functions to add app group 57/240157/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 4 Aug 2020 04:54:09 +0000 (13:54 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 4 Aug 2020 04:54:09 +0000 (13:54 +0900)
Adds:
 - app_manager_add_app_group()
 - app_manager_remove_app_group()

Requires:
 - https://review.tizen.org/gerrit/#/c/platform/core/appfw/aul-1/+/240130/
 - https://review.tizen.org/gerrit/#/c/platform/core/appfw/amd/+/240146/

Change-Id: Icd3025e85615c4a3e27f4ebcdb849d675dafcd65
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
include/app_manager_extension.h
src/app_manager.c

index 5b24761..098eab4 100644 (file)
@@ -202,6 +202,35 @@ int app_manager_unset_app_context_status_cb(app_manager_app_context_status_cb ca
 int app_manager_foreach_visible_app_context(app_manager_app_context_cb callback, void *user_data);
 
 /**
+ * @brief Adds a new group information to the app group.
+ * @details A new app group will be added using the given window ID.
+ * @since_tizen 6.0
+ *
+ * @parma[in]   win_id          The window ID
+ * @return      @c 0 on success,
+ *              otherwise a negative error value
+ * @retval  #APP_MANAGER_ERROR_NONE               Successful
+ * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
+ * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memroy
+ */
+int app_manager_add_app_group(int win_id);
+
+/**
+ * @brief Removes the app group using the given window ID.
+ * @since_tizen 6.0
+ *
+ * @param[in]   win_id          The window ID
+ * @return      @c 0 on success,
+ *              otherwise a negative error value
+ * @retval  #APP_MANAGER_ERROR_NONE               Successful
+ * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #APP_MANAGER_ERROR_IO_ERROR           I/O error
+ * @retval  #APP_MANAGER_ERROR_OUT_OF_MEMORY      Out of memroy
+ */
+int app_manager_remove_app_group(int win_id);
+
+/**
  * @}
  */
 
index a02d747..8956f81 100644 (file)
@@ -22,6 +22,7 @@
 #include <unistd.h>
 
 #include <aul.h>
+#include <aul_app_group.h>
 #include <aul_window.h>
 #include <cynara-client.h>
 #include <dlog.h>
@@ -693,3 +694,25 @@ API int app_manager_foreach_visible_app_context(app_manager_app_context_cb callb
 
        return APP_MANAGER_ERROR_NONE;
 }
+
+API int app_manager_add_app_group(int win_id)
+{
+       int ret;
+
+       ret = aul_app_group_add(win_id);
+       if (ret != AUL_R_OK)
+               return app_manager_error(__aul_error_convert(ret), __FUNCTION__, NULL);
+
+       return APP_MANAGER_ERROR_NONE;
+}
+
+API int app_manager_remove_app_group(int win_id)
+{
+       int ret;
+
+       ret = aul_app_group_remove(win_id);
+       if (ret != AUL_R_OK)
+               return app_manager_error(__aul_error_convert(ret), __FUNCTION__, NULL);
+
+       return APP_MANAGER_ERROR_NONE;
+}