Add a new API to enable/disable the splash screen 45/67045/4 accepted/tizen/common/20160426.143121 accepted/tizen/ivi/20160425.231859 accepted/tizen/mobile/20160425.231847 accepted/tizen/tv/20160425.231820 accepted/tizen/wearable/20160425.231837 submit/tizen/20160425.083419
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 25 Apr 2016 01:09:58 +0000 (10:09 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 25 Apr 2016 02:37:25 +0000 (11:37 +0900)
Change-Id: I1376ae97053bb0e76f69487b6044a7b084bc1825
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
include/app_manager_extension.h
src/app_manager.c

index 9f98b81..b68c933 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __TIZEN_APPFW_APP_MANAGER_EXTENSION_H
 #define __TIZEN_APPFW_APP_MANAGER_EXTENSION_H
 
+#include <stdbool.h>
+
 #include "app_manager.h"
 
 #ifdef __cplusplus
@@ -48,6 +50,24 @@ extern "C" {
 int app_manager_terminate_app(app_context_h app_context);
 
 /**
+ * @brief Sets the display flag to enable/disable the splash screen.
+ * @since_tizen 3.0
+ * @privilege platform
+ * @privilege %http://tizen.org/privilege/packagemanager.admin
+ * @param[in]     app_id  The ID of the application
+ * @param[in]     display The display flag to enable/disable the splash screen
+ *
+ * @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_OUT_OF_MEMORY      Out of memory
+ * @retval  #APP_MANAGER_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval  #APP_MANAGER_ERROR_IO_ERROR           Internal I/O error
+ */
+int app_manager_set_splash_screen_display(const char *app_id, bool display);
+
+/**
  * @}
  */
 
index 8b000a1..e578baa 100644 (file)
@@ -24,6 +24,7 @@
 #include <aul.h>
 #include <dlog.h>
 #include <cynara-client.h>
+#include <package-manager.h>
 
 #include "app_manager.h"
 #include "app_manager_internal.h"
@@ -430,3 +431,48 @@ API int app_manager_get_external_shared_data_path(const char *app_id, char **pat
        return r;
 }
 
+API int app_manager_set_splash_screen_display(const char *app_id, bool display)
+{
+       int r;
+       pkgmgr_client *pc;
+
+       if (app_id == NULL)
+               return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
+
+       pc = pkgmgr_client_new(PC_REQUEST);
+       if (pc == NULL)
+               return app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY,
+                               __FUNCTION__, NULL);
+
+       if (display)
+               r = pkgmgr_client_enable_splash_screen(pc, app_id);
+       else
+               r = pkgmgr_client_disable_splash_screen(pc, app_id);
+       pkgmgr_client_free(pc);
+
+       switch (r) {
+       case PKGMGR_R_OK:
+               r = APP_MANAGER_ERROR_NONE;
+               break;
+       case PKGMGR_R_EINVAL:
+               r = app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER,
+                               __FUNCTION__, NULL);
+               break;
+       case PKGMGR_R_EPRIV:
+               r = app_manager_error(APP_MANAGER_ERROR_PERMISSION_DENIED,
+                               __FUNCTION__, NULL);
+               break;
+       case PKGMGR_R_ENOMEM:
+               r = app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY,
+                               __FUNCTION__, NULL);
+               break;
+       default:
+               r = app_manager_error(APP_MANAGER_ERROR_IO_ERROR,
+                               __FUNCTION__, NULL);
+               break;
+       }
+
+       return r;
+}
+