*/
typedef enum
{
- APP_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ APP_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
APP_MANAGER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
APP_MANAGER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
APP_MANAGER_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
- APP_MANAGER_ERROR_NO_SUCH_APP = TIZEN_ERROR_APPLICATION_CLASS | 0x01, /**< No such application */
+ APP_MANAGER_ERROR_NO_SUCH_APP = TIZEN_ERROR_APPLICATION_MANAGER | 0x01, /**< No such application */
- APP_MANAGER_ERROR_DB_FAILED = TIZEN_ERROR_APPLICATION_CLASS | 0x03, /**< Database error */
- APP_MANAGER_ERROR_INVALID_PACKAGE = TIZEN_ERROR_APPLICATION_CLASS | 0x04, /**< Invalid package name */
+ APP_MANAGER_ERROR_DB_FAILED = TIZEN_ERROR_APPLICATION_MANAGER | 0x03, /**< Database error */
+ APP_MANAGER_ERROR_INVALID_PACKAGE = TIZEN_ERROR_APPLICATION_MANAGER | 0x04, /**< Invalid package name */
+ APP_MANAGER_ERROR_APP_NO_RUNNING = TIZEN_ERROR_APPLICATION_MANAGER | 0x05, /**< App is not running */
+ APP_MANAGER_ERROR_REQUEST_FAILED = TIZEN_ERROR_APPLICATION_MANAGER | 0x06, /**< Internal aul request error */
+ APP_MANAGER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED /**< Permission denied */
} app_manager_error_e;
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
+ * @remarks The specified @a path should be released.
+ *
+ * @param[in] app_id The ID of the application
+ * @param[in,out] path The absolute path to the shared data directory of the application
+ * specified with the @a app_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_NO_SUCH_APP No such application
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+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
+ * @remarks The specified @a path should be released.
+ *
+ * @param[in] app_id The ID of the application
+ * @param[in,out] path The absolute path to the shared resource directory of the application
+ * specified with the @a app_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_NO_SUCH_APP No such application
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_manager_get_shared_resource_path(const char *app_id, char **path);
+
+/**
+ * @brief Gets the absolute path to the shared trusted directory of the application specified
+ * 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
+ * @remarks The specified @a path should be released.
+ *
+ * @param[in] app_id The ID of the application
+ * @param[in,out] path The absolute path to the shared trusted directory of the application
+ * specified with the @a app_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_NO_SUCH_APP No such application
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+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
+ * @remarks The specified @a path should be released.
+ *
+ * @param[in] app_id The ID of the application
+ * @param[in,out] path The absolute path to the shared data directory of the application
+ * specified with the @a app_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_NO_SUCH_APP No such application
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_manager_get_external_shared_data_path(const char *app_id, char **path);
#define __START_OF_DEPRECATED_API
typedef bool (*app_manager_ui_app_info_cb) (ui_app_info_h ui_app_info, void *user_data);
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License.
*/
case APP_MANAGER_ERROR_INVALID_PACKAGE:
return "INVALID_PACKAGE";
+ case APP_MANAGER_ERROR_APP_NO_RUNNING:
+ return "NO_RUNNING";
+
+ case APP_MANAGER_ERROR_REQUEST_FAILED:
+ return "AUL_REQUEST_FAILED";
+
+ case APP_MANAGER_ERROR_PERMISSION_DENIED:
+ return "PERMISSION_DENIED";
+
default :
return "UNKNOWN";
}
{
if (description)
{
- LOGE("[%s] %s(0x%08x) : %s", function, app_manager_error_to_string(error), error, description);
+ LOGE("[%s] %s(0x%08x) : %s", function, app_manager_error_to_string(error), error, description);
}
else
{
- LOGE("[%s] %s(0x%08x)", function, app_manager_error_to_string(error), error);
+ LOGE("[%s] %s(0x%08x)", function, app_manager_error_to_string(error), error);
}
return error;
return APP_MANAGER_ERROR_NONE;
}
+
+int app_manager_get_shared_data_path(const char *app_id, char **path)
+{
+ int r;
+ int retval = aul_get_app_shared_data_path_by_appid(app_id, path);
+
+ switch (retval) {
+ case AUL_R_OK:
+ r = APP_MANAGER_ERROR_NONE;
+ break;
+ case AUL_R_ENOAPP:
+ r = app_manager_error(APP_MANAGER_ERROR_NO_SUCH_APP, __FUNCTION__, NULL);
+ break;
+ case AUL_R_EINVAL:
+ r = app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+ break;
+ case AUL_R_ERROR:
+ r = app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ break;
+ default:
+ r = app_manager_error(APP_MANAGER_ERROR_REQUEST_FAILED, __FUNCTION__, NULL);
+ break;
+ }
+
+ return r;
+}
+
+int app_manager_get_shared_resource_path(const char *app_id, char **path)
+{
+ int r;
+ int retval = aul_get_app_shared_resource_path_by_appid(app_id, path);
+
+ switch (retval) {
+ case AUL_R_OK:
+ r = APP_MANAGER_ERROR_NONE;
+ break;
+ case AUL_R_ENOAPP:
+ r = app_manager_error(APP_MANAGER_ERROR_NO_SUCH_APP, __FUNCTION__, NULL);
+ break;
+ case AUL_R_EINVAL:
+ r = app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+ break;
+ case AUL_R_ERROR:
+ r = app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ break;
+ default:
+ r = app_manager_error(APP_MANAGER_ERROR_REQUEST_FAILED, __FUNCTION__, NULL);
+ break;
+ }
+
+ return r;
+}
+
+int app_manager_get_shared_trusted_path(const char *app_id, char **path)
+{
+ int r;
+ int retval = aul_get_app_shared_trusted_path_by_appid(app_id, path);
+
+ switch (retval) {
+ case AUL_R_OK:
+ r = APP_MANAGER_ERROR_NONE;
+ break;
+ case AUL_R_ENOAPP:
+ r = app_manager_error(APP_MANAGER_ERROR_NO_SUCH_APP, __FUNCTION__, NULL);
+ break;
+ case AUL_R_EINVAL:
+ r = app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+ break;
+ case AUL_R_ERROR:
+ r = app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ break;
+ default:
+ r = app_manager_error(APP_MANAGER_ERROR_REQUEST_FAILED, __FUNCTION__, NULL);
+ break;
+ }
+
+ return r;
+}
+
+int app_manager_get_external_shared_data_path(const char *app_id, char **path)
+{
+ int r;
+ int retval = aul_get_app_external_shared_data_path_by_appid(app_id, path);
+
+ switch (retval) {
+ case AUL_R_OK:
+ r = APP_MANAGER_ERROR_NONE;
+ break;
+ case AUL_R_ENOAPP:
+ r = app_manager_error(APP_MANAGER_ERROR_NO_SUCH_APP, __FUNCTION__, NULL);
+ break;
+ case AUL_R_EINVAL:
+ r = app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+ break;
+ case AUL_R_ERROR:
+ r = app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ break;
+ default:
+ r = app_manager_error(APP_MANAGER_ERROR_REQUEST_FAILED, __FUNCTION__, NULL);
+ break;
+ }
+
+ return r;
+}