From: Sangyoon Jang Date: Tue, 26 May 2015 06:40:15 +0000 (+0900) Subject: Merge 2.4 source X-Git-Tag: submit/tizen/20150526.104937^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F39897%2F1;p=platform%2Fcore%2Fapi%2Fapp-manager.git Merge 2.4 source update doxygen added: app_manager_request_terminate_bg_app Change-Id: I59faa65ea91325a4d99612e6fdfd53cc2c52ddf5 Signed-off-by: Sangyoon Jang --- diff --git a/include/app_context.h b/include/app_context.h index c4aa724..5f0e90e 100644 --- a/include/app_context.h +++ b/include/app_context.h @@ -37,14 +37,14 @@ extern "C" { /** * @brief Application context handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef struct app_context_s *app_context_h; /** * @brief Enumeration for Application Context Event. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { @@ -55,7 +55,7 @@ typedef enum /** * @brief Destroys the application context handle and releases all its resources. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_context The application context handle * @return @c 0 on success, * otherwise a negative error value @@ -69,7 +69,7 @@ int app_context_destroy(app_context_h app_context); /** * @brief Gets the package with the given application context. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks This function is @b deprecated. Use app_context_get_app_id() instead. \n * You must release @a package using free(). * @param[in] app_context The application context @@ -78,7 +78,6 @@ int app_context_destroy(app_context_h app_context); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_context_get_package(app_context_h app_context, char **package); @@ -86,7 +85,7 @@ int app_context_get_package(app_context_h app_context, char **package); /** * @brief Gets the application ID with the given application context. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks You must release @a app_id using free(). * @param[in] app_context The application context * @param[out] app_id The application ID of the given application context @@ -94,7 +93,6 @@ int app_context_get_package(app_context_h app_context, char **package); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_context_get_app_id(app_context_h app_context, char **app_id); @@ -102,22 +100,20 @@ int app_context_get_app_id(app_context_h app_context, char **app_id); /** * @brief Gets the process ID with the given application context. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_context The application context * @param[out] pid The process ID of the given application context * @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_DB_FAILED Database error occurred - * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_context_get_pid(app_context_h app_context, pid_t *pid); /** * @brief Checks whether the application with the given application context is terminated. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_context The application context * @param[out] terminated @c true if the application is terminated, \n * otherwise @c false if the application is running @@ -125,15 +121,13 @@ int app_context_get_pid(app_context_h app_context, pid_t *pid); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred - * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_context_is_terminated(app_context_h app_context, bool *terminated); /** * @brief Checks whether two application contexts are equal. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] lhs The first application context to compare * @param[in] rhs The second application context to compare * @param[out] equal @c true if the application contexts are equal, \n @@ -142,22 +136,19 @@ int app_context_is_terminated(app_context_h app_context, bool *terminated); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred - * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_context_is_equal(app_context_h lhs, app_context_h rhs, bool *equal); /** * @brief Clones the application context handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[out] clone The newly created application context handle, if cloning is successful * @param[in] app_context The application context * @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_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_context_clone(app_context_h *clone, app_context_h app_context); diff --git a/include/app_info.h b/include/app_info.h index fc6c3f5..eac0cba 100644 --- a/include/app_info.h +++ b/include/app_info.h @@ -44,25 +44,25 @@ extern "C" { /** * @brief Application information handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef struct app_info_s *app_info_h; /** * @brief Application filter handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef struct app_info_filter_s *app_info_filter_h; /** * @brief Application metadata filter handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef struct app_info_metadata_filter_s *app_info_metadata_filter_h; /** * @brief Called to get the application information once for each installed application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information of each installed application * @param[in] user_data The user data passed from the foreach function * @return @c true to continue with the next iteration of the loop, \n @@ -74,7 +74,7 @@ typedef bool (*app_info_filter_cb) (app_info_h app_info, void *user_data); /** * @brief Called to get application metadata in app_info_foreach_metadata(). - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] metadata_name The name of the metadata * @param[in] metadata_value The value of the metadata * @param[in] user_data The user data passed to app_info_foreach_metadata() @@ -85,9 +85,20 @@ typedef bool (*app_info_filter_cb) (app_info_h app_info, void *user_data); */ typedef bool (*app_info_metadata_cb) (const char *metadata_key, const char *metadata_value, void *user_data); +/** + * @brief Enumeration for Application Information Event. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum +{ + APP_INFO_EVENT_INSTALLED, /**< The application is newly installed */ + APP_INFO_EVENT_UNINSTALLED, /**< The application is uninstalled */ + APP_INFO_EVENT_UPDATED, /**< The application is updated */ +} app_info_event_e; + /** * @brief Creates the application information handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @param[in] app_id The application ID @@ -98,7 +109,7 @@ typedef bool (*app_info_metadata_cb) (const char *metadata_key, const char *meta * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #APP_MANAGER_ERROR_NO_SUCH_APP The app is not installed * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied * @see app_manager_foreach_app_info() * @see app_manager_get_app_info() */ @@ -106,7 +117,7 @@ int app_info_create(const char *app_id, app_info_h *app_info); /** * @brief Destroys the application information handle and releases all its resources. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information handle * @return @c 0 on success, * otherwise a negative error value @@ -119,7 +130,7 @@ int app_info_destroy(app_info_h app_info); /** * @brief Gets the application ID with the given application context. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks You must release @a app_id using free(). * @param[in] app_info The application information * @param[out] app_id The application ID of the given application context @@ -127,14 +138,13 @@ int app_info_destroy(app_info_h app_info); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_info_get_app_id(app_info_h app_info, char **app_id); /** * @brief Gets the executable path of the application - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks You must release @a exec path using free(). * @param[in] app_info The application information * @param[out] exec The executable path of the application @@ -146,13 +156,9 @@ int app_info_get_app_id(app_info_h app_info, char **app_id); */ int app_info_get_exec(app_info_h app_info, char **exec); -/* FIXME: Temporary patch to prevent build break. - This MUST be removed after packages using the below API are modified. */ -#define app_info_get_name app_info_get_label - /** * @brief Gets the label of the application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks You must release @a label using free(). * @param[in] app_info The application information * @param[out] label The label of the application @@ -160,14 +166,13 @@ int app_info_get_exec(app_info_h app_info, char **exec); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_info_get_label(app_info_h app_info, char **label); /** * @brief Gets the localed name of the application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @remarks You must release localed name using free(). @@ -179,13 +184,13 @@ int app_info_get_label(app_info_h app_info, char **label); * @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_PERMISSION_DENIED Permission denied */ int app_info_get_localed_label(const char *app_id, const char *locale, char **label); /** * @brief Gets the absolute path to the icon image. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks You must release @a path using free(). * @param[in] app_info The application information * @param[out] path The absolute path to the icon @@ -193,14 +198,13 @@ int app_info_get_localed_label(const char *app_id, const char *locale, char **la * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_info_get_icon(app_info_h app_info, char **path); /** * @brief Gets the package name. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks You must release @a package name using free(). * @param[in] app_info The application information * @param[out] package The package name @@ -208,14 +212,13 @@ int app_info_get_icon(app_info_h app_info, char **path); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_info_get_package(app_info_h app_info, char **package); /** * @brief Gets the package type name. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks You must release package @a type name using free(). * @param[in] app_info The application information * @param[out] type The package type @@ -223,14 +226,13 @@ int app_info_get_package(app_info_h app_info, char **package); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_info_get_type(app_info_h app_info, char **type); /** * @brief Gets the list of metadata for a particular application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information * @param[in] callback The callback function for list * @param[in] user_data The user data to be passed to callback function @@ -238,12 +240,13 @@ int app_info_get_type(app_info_h app_info, char **type); * 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 */ int app_info_foreach_metadata(app_info_h app_info, app_info_metadata_cb callback, void *user_data); /** * @brief Checks whether application information is nodisplay. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information * @param[out] nodisplay @c true if the application is nodisplay, \n * otherwise @c false @@ -256,7 +259,7 @@ int app_info_is_nodisplay(app_info_h app_info, bool *nodisplay); /** * @brief Checks whether two application information are equal. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] lhs The first application information to compare * @param[in] rhs The second application information to compare * @param[out] equal @c true if the application information are equal, \n @@ -265,14 +268,12 @@ int app_info_is_nodisplay(app_info_h app_info, bool *nodisplay); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred - * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory */ int app_info_is_equal(app_info_h lhs, app_info_h rhs, bool *equal); /** * @brief Checks whether application is enabled. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information * @param[out] enabled @c true if the application is enabled, \n * otherwise @c false @@ -285,7 +286,7 @@ int app_info_is_enabled(app_info_h app_info, bool *enabled); /** * @brief Checks whether application is launched on booting time. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information * @param[out] onboot @c true if the application is launched on booting time, \n * otherwise @c false @@ -298,7 +299,7 @@ int app_info_is_onboot(app_info_h app_info, bool *onboot); /** * @brief Checks whether application is preloaded. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information * @param[out] preload @c true if the application is preloaded, \n * otherwise @c false @@ -311,22 +312,22 @@ int app_info_is_preload(app_info_h app_info, bool *preload); /** * @brief Clones the application information handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[out] clone A newly created application information handle, if successfully cloned * @param[in] app_info The application information * @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_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory + * @retval #APP_MANAGER_ERROR_NO_SUCH_APP The app is not installed */ int app_info_clone(app_info_h *clone, app_info_h app_info); /** * @brief Creates the application information filter handle from DB. * All filter properties will be ANDed. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @param[out] handle The pointer to the application info filter handle @@ -335,25 +336,26 @@ int app_info_clone(app_info_h *clone, app_info_h app_info); * @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 I/O error + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_info_filter_create(app_info_filter_h *handle); /** * @brief Destroys the application information filter handle, freeing up all the resources. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application info filter handle * @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_IO_ERROR I/O error */ int app_info_filter_destroy(app_info_filter_h handle); /** * @brief Adds a boolean filter property to the filter handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application info filter handle * @param[in] property The integer property name * @param[in] value The value corresponding to the property @@ -361,13 +363,13 @@ int app_info_filter_destroy(app_info_filter_h handle); * 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_IO_ERROR I/O error */ int app_info_filter_add_bool(app_info_filter_h handle, const char *property, const bool value); /** * @brief Adds a string filter property to the filter handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application info filter handle * @param[in] property The integer property name * @param[in] value The value corresponding to the property @@ -375,13 +377,13 @@ int app_info_filter_add_bool(app_info_filter_h handle, const char *property, con * 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_IO_ERROR I/O error */ int app_info_filter_add_string(app_info_filter_h handle, const char *property, const char *value); /** * @brief Gets the count of filtered apps. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application info filter handle * @param[out] count The pointer to the variable for count * @return @c 0 on success, @@ -394,7 +396,7 @@ int app_info_filter_count_appinfo(app_info_filter_h handle, int *count); /** * @brief Executes the user supplied callback function for each application that satisfy the filter conditions. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application info filter handle * @param[in] callback The callback function * @param[in] user_data The user data to be passed to the callback function @@ -402,13 +404,13 @@ int app_info_filter_count_appinfo(app_info_filter_h handle, int *count); * 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_IO_ERROR I/O error */ int app_info_filter_foreach_appinfo(app_info_filter_h handle, app_info_filter_cb callback, void * user_data); /** * @brief Creates the application's metadata information filter handle from DB. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @param[out] handle The pointer to the application metadata info filter handle @@ -417,19 +419,20 @@ int app_info_filter_foreach_appinfo(app_info_filter_h handle, app_info_filter_cb * @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 I/O error + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_info_metadata_filter_create(app_info_metadata_filter_h *handle); /** * @brief Destroys the application's metadata information filter handle. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application info filter handle * @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_IO_ERROR I/O error */ int app_info_metadata_filter_destroy(app_info_metadata_filter_h handle); @@ -437,7 +440,7 @@ int app_info_metadata_filter_destroy(app_info_metadata_filter_h handle); * @brief Adds filter condition for the query API. * @details The query will search the entire application metadata information collected from * the manifest file of all the installed packages. You can specify value as @c NULL to search based on key only. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application metadata info filter handle * @param[in] key The pointer to metadata key * @param[in] value The pointer to metadata value @@ -445,7 +448,7 @@ int app_info_metadata_filter_destroy(app_info_metadata_filter_h handle); * 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_IO_ERROR I/O error */ int app_info_metadata_filter_add(app_info_metadata_filter_h handle, const char *key, const char *value); @@ -454,7 +457,7 @@ int app_info_metadata_filter_add(app_info_metadata_filter_h handle, const char * * @details The query will search the entire application metadata information collected from * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns * negative value, no more callbacks will be called and API will return. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] handle The pointer to the application metadata info filter handle * @param[in] callback The function pointer to callback * @param[in] user_data The pointer to user data @@ -462,7 +465,7 @@ int app_info_metadata_filter_add(app_info_metadata_filter_h handle, const char * * 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_IO_ERROR I/O error */ int app_info_metadata_filter_foreach(app_info_metadata_filter_h handle, app_info_filter_cb callback, void *user_data); diff --git a/include/app_manager.h b/include/app_manager.h index 4606594..d63ecd3 100644 --- a/include/app_manager.h +++ b/include/app_manager.h @@ -37,7 +37,7 @@ extern "C" { /** * @brief Enumerations for Application Manager Error . - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif */ typedef enum { @@ -57,7 +57,7 @@ typedef enum /** * @internal * @brief Called when an application is launched or terminated. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_context The application context of the application launched or terminated * @param[in] event The application context event * @param[in] user_data The user data passed from the foreach function @@ -69,7 +69,7 @@ typedef void (*app_manager_app_context_event_cb) (app_context_h app_context, app /** * @brief Called to get the application context once for each running application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_context The application context of each running application * @param[in] user_data The user data passed from the foreach function * @return @c true to continue with the next iteration of the loop, \n @@ -81,7 +81,7 @@ typedef bool (*app_manager_app_context_cb) (app_context_h app_context, void *use /** * @brief Called to get the application information once for each installed application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_info The application information of each installed application * @param[in] user_data The user data passed from the foreach function * @return @c true to continue with the next iteration of the loop, \n @@ -92,9 +92,8 @@ typedef bool (*app_manager_app_context_cb) (app_context_h app_context, void *use typedef bool (*app_manager_app_info_cb) (app_info_h app_info, void *user_data); /** - * @internal * @brief Registers a callback function to be invoked when the applications get launched or terminated. - * @since_tizen 2.3 + * @since_tizen 2.4 * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @param[in] callback The callback function to register @@ -104,7 +103,7 @@ typedef bool (*app_manager_app_info_cb) (app_info_h app_info, void *user_data); * @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_PERMISSION_DENIED Permission denied * @post It will invoke app_manager_app_context_event_cb() when the application is launched or terminated. * @see app_manager_unset_app_context_event_cb() * @see app_manager_app_context_event_cb() @@ -112,9 +111,8 @@ typedef bool (*app_manager_app_info_cb) (app_info_h app_info, void *user_data); int app_manager_set_app_context_event_cb(app_manager_app_context_event_cb callback, void *user_data); /** - * @internal * @brief Unregisters the callback function. - * @since_tizen 2.3 + * @since_tizen 2.4 * @see app_manager_set_app_event_cb() * @see app_manager_app_context_event_cb() */ @@ -122,7 +120,7 @@ void app_manager_unset_app_context_event_cb(void); /** * @brief Retrieves all application contexts of running applications. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @param[in] callback The callback function to invoke @@ -131,7 +129,7 @@ void app_manager_unset_app_context_event_cb(void); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied * @post This function invokes app_manager_app_context_cb() for each application context. * @see app_manager_app_context_cb() */ @@ -139,7 +137,7 @@ int app_manager_foreach_app_context(app_manager_app_context_cb callback, void *u /** * @brief Gets the application context for the given ID of the application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @remarks This function returns #APP_MANAGER_ERROR_NO_SUCH_APP if the application with the given application ID is not running. \n @@ -150,16 +148,15 @@ int app_manager_foreach_app_context(app_manager_app_context_cb callback, void *u * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_manager_get_app_context(const char *app_id, app_context_h *app_context); /** * @brief Gets the ID of the application for the given process ID. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @remarks This function returns #APP_MANAGER_ERROR_NO_SUCH_APP if the application with the given process ID is not valid. \n @@ -170,20 +167,14 @@ int app_manager_get_app_context(const char *app_id, app_context_h *app_context); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory - * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_manager_get_app_id(pid_t pid, char **app_id); -/* FIXME: Temporary patch to prevent build break. - This MUST be removed after packages using the below API are modified. */ -#define app_manager_get_package app_manager_get_app_id - /** * @brief Checks whether the application with the given package name is running. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] app_id The ID of the application * @param[out] running @c true if the application is running, \n * otherwise @c false if not running @@ -196,7 +187,7 @@ int app_manager_is_running(const char *app_id, bool *running); /** * @brief Resumes the application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/appmanager.launch * @param[in] app_context The application context @@ -204,16 +195,34 @@ int app_manager_is_running(const char *app_id, bool *running); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_APP_NO_RUNNING App is not running - * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal resume error - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_APP_NO_RUNNING App is not running + * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal resume error + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_manager_resume_app(app_context_h app_context); /** - * @internal + * @brief Terminates the back ground application.\n + * UI applications that are in paused state or some service applications could be required to terminate by this API. + * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/appmanager.bgkill + * @remarks This function returns after it just sends a request for terminating a background application.\n + * Platform will decide if the target application could be terminated or not according to the state of the target application. + * @param[in] app_context The application context + * @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_REQUEST_FAILED Failed to send terminate request + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + */ +int app_manager_request_terminate_bg_app(app_context_h app_context); + +/* FIXME: should be separated */ +/** * @brief Opens the application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/appmanager.launch * @param[in] app_id The ID of the application @@ -221,16 +230,16 @@ int app_manager_resume_app(app_context_h app_context); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application - * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal open error - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application + * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal open error + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_manager_open_app(const char *app_id); +/* FIXME: should be separated */ /** - * @internal * @brief Terminates the application. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel platform * @privilege %http://tizen.org/privilege/appmanager.kill * @param[in] app_context The application context @@ -238,14 +247,14 @@ int app_manager_open_app(const char *app_id); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal terminate error - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal terminate error + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_manager_terminate_app(app_context_h app_context); /** * @brief Retrieves all installed applications information. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @param[in] callback The callback function to invoke @@ -254,7 +263,7 @@ int app_manager_terminate_app(app_context_h app_context); * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied * @post This function invokes app_manager_app_info_cb() for each application information. * @see app_manager_app_info_cb() */ @@ -262,7 +271,7 @@ int app_manager_foreach_app_info(app_manager_app_info_cb callback, void *user_da /** * @brief Gets the application information for the given application ID. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @privlevel public * @privilege %http://tizen.org/privilege/packagemanager.info * @remarks You must release @a app_info using app_info_destroy(). @@ -272,9 +281,9 @@ int app_manager_foreach_app_info(app_manager_app_info_cb callback, void *user_da * otherwise a negative error value * @retval #APP_MANAGER_ERROR_NONE Successful * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory - * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application + * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied */ int app_manager_get_app_info(const char *app_id, app_info_h *app_info); @@ -282,7 +291,7 @@ int app_manager_get_app_info(const char *app_id, app_info_h *app_info); * @brief Gets the absolute path to the shared data directory of the application specified * with an application ID. * @details An application can only read the files of other application's shared data directory. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks The specified @a path should be released. * * @param[in] app_id The ID of the application @@ -301,7 +310,7 @@ int app_manager_get_shared_data_path(const char *app_id, char **path); * @brief Gets the absolute path to the shared resource directory of the application specified * with an application ID. * @details An application can only read the files of other application's shared resource directory. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks The specified @a path should be released. * * @param[in] app_id The ID of the application @@ -321,7 +330,7 @@ int app_manager_get_shared_resource_path(const char *app_id, char **path); * with an application ID. * @details An application signed with the same certificate can read and write the files of * other application's shared trusted directory. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks The specified @a path should be released. * * @param[in] app_id The ID of the application @@ -340,7 +349,7 @@ int app_manager_get_shared_trusted_path(const char *app_id, char **path); * @brief Gets the absolute path to the shared data directory of the application specified * with an application ID. * @details An application can only read the files of other application's shared data directory. - * @since_tizen 2.3 + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks The specified @a path should be released. * * @param[in] app_id The ID of the application diff --git a/src/app_info.c b/src/app_info.c index 9da7057..6e5db43 100644 --- a/src/app_info.c +++ b/src/app_info.c @@ -341,8 +341,7 @@ API int app_info_get_localed_label(const char *app_id, const char *locale, char return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); } - pkgmgrinfo_appinfo_get_localed_label(app_id, locale, &val); - if (val == NULL) + if (pkgmgrinfo_appinfo_usr_get_localed_label(app_id, locale, getuid(), &val)) { return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); } diff --git a/src/app_manager.c b/src/app_manager.c index 6e38647..d29ad60 100644 --- a/src/app_manager.c +++ b/src/app_manager.c @@ -258,6 +258,41 @@ API int app_manager_terminate_app(app_context_h app_context) return APP_MANAGER_ERROR_NONE; } +API int app_manager_request_terminate_bg_app(app_context_h app_context) +{ +#if 0 + int retval = APP_MANAGER_ERROR_NONE; + pid_t pid = 0; +#endif + if (app_context == NULL) + { + return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + } + /* TODO: implement aul_terminate_bgapp_pid */ +#if 0 + if (app_context_get_pid(app_context, &pid) != APP_MANAGER_ERROR_NONE) { + return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to get the process ID"); + } + + retval = aul_terminate_bgapp_pid(pid); + if (retval == AUL_R_EINVAL) + { + LOGE("[%s] APP_MANAGER_ERROR_INVALID_PARAMETER(0x%08x) : Invalid param", __FUNCTION__, APP_MANAGER_ERROR_INVALID_PARAMETER); + return APP_MANAGER_ERROR_INVALID_PARAMETER; + } + else if (retval == AUL_R_EILLACC) + { + LOGE("[%s] APP_MANAGER_ERROR_PERMISSION_DENIED(0x%08x) : Permission denied", __FUNCTION__, APP_MANAGER_ERROR_PERMISSION_DENIED); + return APP_MANAGER_ERROR_PERMISSION_DENIED; + } + else if (retval < 0) + { + return APP_MANAGER_ERROR_REQUEST_FAILED; + } +#endif + return APP_MANAGER_ERROR_NONE; +} + API int app_manager_is_running(const char *app_id, bool *running) { if (app_id == NULL)