Add new api to check application support ambient mode 51/140651/2
authorjunsuk77.oh <junsuk77.oh@samsung.com>
Wed, 26 Jul 2017 00:39:15 +0000 (09:39 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 9 Aug 2017 04:39:36 +0000 (13:39 +0900)
Change-Id: Ia1dcdf9c148d0c5ef3f70f9af6013d54a8b811a0
Signed-off-by: junsuk77.oh <junsuk77.oh@samsung.com>
include/app_info_extension.h
src/app_info.c

index cf23ece41b9c0f0a4b0de45a10269dcac8813500..1dcb8d05734cbe5cbe3a96576cf8712b624316af 100644 (file)
@@ -114,6 +114,19 @@ int app_info_foreach_category(app_info_h app_info, app_info_category_cb callback
  */
 int app_info_get_app_component_type(app_info_h app_info, app_info_app_component_type_e *type);
 
+/**
+ * @brief  Checks whether application supports ambient mode.
+ * @since_tizen 3.0
+ * @param[in]   app_info         The application information
+ * @param[out]  support_ambient  @c true if the application support ambient mode, \n
+ *              otherwise @c false
+ * @return      @c 0 on success,
+ *              otherwise a negative error value
+ * @retval  #APP_MANAGER_ERROR_NONE               Successful
+ * @retval  #APP_MANAGER_ERROR_INVALID_PARAMETER  Invalid parameter
+ */
+int app_info_is_support_ambient(app_info_h app_info, bool *support_ambient);
+
 #ifdef __cplusplus
 }
 #endif
index fc60880083db6e3ea182e291df96f8d7a0bbb9b0..46d42f4cd96c62d04d696c72567d5948915b7791 100644 (file)
@@ -662,6 +662,20 @@ API int app_info_is_preload(app_info_h app_info, bool *preload)
        return APP_MANAGER_ERROR_NONE;
 }
 
+API int app_info_is_support_ambient(app_info_h app_info, bool *support_ambient)
+{
+       bool val;
+
+       if (app_info == NULL || support_ambient == NULL)
+               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+       if (pkgmgrinfo_appinfo_is_support_ambient(app_info->pkg_app_info, &val) < 0)
+               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+       *support_ambient = val;
+       return APP_MANAGER_ERROR_NONE;
+}
+
 API int app_info_clone(app_info_h *clone, app_info_h app_info)
 {
        app_info_h info;