Add app_info_is_support_ambient() 97/207097/2 accepted/tizen/unified/20190627.115217 submit/tizen/20190625.052206
authorDaehyeon Jung <darrenh.jung@samsung.com>
Thu, 30 May 2019 04:15:26 +0000 (13:15 +0900)
committerDaehyeon Jung <darrenh.jung@samsung.com>
Tue, 11 Jun 2019 00:02:31 +0000 (09:02 +0900)
Change-Id: I5040820ab9d4ffbde2398f8cafd03cf9b935c4a1
Signed-off-by: Daehyeon Jung <darrenh.jung@samsung.com>
include/app_info.h
src/app_info.c

index 2ae90a315985393a50ea38aaa0cf871d1896ec14..a9f774037770f9d48834f7f56b2c29baca1f139d 100644 (file)
@@ -383,6 +383,19 @@ int app_info_is_onboot(app_info_h app_info, bool *onboot);
  */
 int app_info_is_preload(app_info_h app_info, bool *preload);
 
+/**
+ * @brief  Checks whether the application supports ambient mode.
+ * @since_tizen 5.5
+ * @param[in]   app_info         The application information
+ * @param[out]  ambient_supported  @c true if the application supports 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 *ambient_supported);
+
 /**
  * @brief  Clones the application information handle.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
index d101c22b89283d8a4395841a99d3c5ccda17d205..e9e23c6590094a9396ea2fbc81218f3cac775a2d 100644 (file)
@@ -681,6 +681,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;