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 2.3
- */
-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
* @privlevel public
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * 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.
- */
-
-
-#ifndef __TIZEN_APPFW_APP_INFO_INTERNAL_H
-#define __TIZEN_APPFW_APP_INFO_INTERNAL_H
-
-#include "app_info.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
-* @addtogroup CAPI_APP_INFO_MODULE
-* @{
-*/
-
-#define __START_OF_DEPRECATED_API
-int app_info_get_name(app_info_h app_info, char **name);
-
-typedef struct ui_app_info_s *ui_app_info_h;
-typedef struct service_app_info_s *service_app_info_h;
-int ui_app_info_destroy(ui_app_info_h ui_app_info);
-int ui_app_info_get_app_id(ui_app_info_h ui_app_info, char **app_id);
-int ui_app_info_get_label(ui_app_info_h ui_app_info, char **label);
-int ui_app_info_get_icon(ui_app_info_h ui_app_info, char **iconpath);
-int ui_app_info_is_equal(ui_app_info_h lhs, ui_app_info_h rhs, bool *equal);
-int ui_app_info_clone(ui_app_info_h *clone, ui_app_info_h ui_app_info);
-int ui_app_info_get_package(ui_app_info_h ui_app_info, char **package);
-int ui_app_info_get_type(ui_app_info_h ui_app_info, char **type);
-//int ui_app_info_get_category(ui_app_info_h ui_app_info, char **category);
-int service_app_info_destroy(service_app_info_h service_app_info);
-int service_app_info_get_app_id(service_app_info_h service_app_info, char **app_id);
-int service_app_info_get_label(service_app_info_h service_app_info, char **label);
-int service_app_info_get_icon(service_app_info_h service_app_info, char **iconpath);
-int service_app_info_is_equal(service_app_info_h lhs, service_app_info_h rhs, bool *equal);
-int service_app_info_clone(service_app_info_h *clone, service_app_info_h service_app_info);
-int service_app_info_get_package(service_app_info_h service_app_info, char **package);
-int service_app_info_get_type(service_app_info_h service_app_info, char **type);
-int service_app_info_is_onboot(service_app_info_h service_app_info, bool *onboot);
-int service_app_info_is_autorestart(service_app_info_h service_app_info, bool *autorestart);
-#define __END_OF_DEPRECATED_API
-
-/**
-* @}
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_APPFW_APP_INFO_INTERNAL_H */
* 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.
*/
#ifndef __TIZEN_APPFW_APP_MANAGER_INTERNAL_H
#define __TIZEN_APPFW_APP_MANAGER_INTERNAL_H
#include "app_manager.h"
-#include "app_info_internal.h"
#ifdef __cplusplus
extern "C" {
* @{
*/
-#define __START_OF_DEPRECATED_API
-typedef void (*app_manager_app_info_event_cb) (app_info_h app_info, app_info_event_e event, void *user_data);
-int app_manager_get_ui_app_info(const char *app_id, ui_app_info_h *ui_app_info);
-int app_manager_get_service_app_info(const char *app_id, service_app_info_h *service_app_info);
-int app_manager_get_app_package(const char *app_id, app_context_h *app_context);
-int app_manager_set_app_info_event_cb(app_manager_app_info_event_cb callback, void *user_data);
-void app_manager_unset_app_info_event_cb(void);
-#define __END_OF_DEPRECATED_API
-
int app_manager_error(app_manager_error_e error, const char* function, const char *description);
int app_context_foreach_app_context(app_manager_app_context_cb callback, void *user_data);
int app_info_get_app_info(const char *app_id, app_info_h *app_info);
-int app_info_set_event_cb(app_manager_app_info_event_cb callback, void *user_data);
-
-void app_info_unset_event_cb(void);
-
/**
* @}
*/
void *user_data;
} foreach_metadata_context_s;
-static pkgmgr_client *package_event_listener = NULL;
-static app_manager_app_info_event_cb app_info_event_cb = NULL;
-static void *app_info_event_cb_data = NULL;
-
static int app_info_convert_str_property(const char *property, char **converted_property)
{
if (property == NULL)
return APP_MANAGER_ERROR_NONE;
}
-int app_info_get_app_info(const char *app_id, app_info_h *app_info)
-{
- return app_info_create(app_id, app_info);
-}
-
int app_info_create(const char *app_id, app_info_h *app_info)
{
pkgmgrinfo_pkginfo_h pkginfo = NULL;
return APP_MANAGER_ERROR_NONE;
}
-static app_info_event_e app_info_get_app_info_event(const char *value)
-{
- if (!strcasecmp(value, "install"))
- {
- return APP_INFO_EVENT_INSTALLED;
- }
- else if (!strcasecmp(value, "uninstall"))
- {
- return APP_INFO_EVENT_UNINSTALLED;
- }
- else if (!strcasecmp(value, "update"))
- {
- return APP_INFO_EVENT_UPDATED;
- }
- else
- {
- return APP_MANAGER_ERROR_INVALID_PARAMETER;
- }
-}
-
-static int app_info_package_event_listener_cb(
- int id, const char *type, const char *package, const char *key, const char *val, const void *msg, void *data)
-{
- static app_info_event_e event_type = -1;
- static int req_id = -1;
- app_info_h app_info;
-
- if (!strcasecmp(key, "start"))
- {
- req_id = id;
- event_type = app_info_get_app_info_event(val);
- }
- else if (!strcasecmp(key, "end") && !strcasecmp(val, "ok")
- && event_type >= 0 && id == req_id)
- {
- if (app_info_create(package, &app_info) == APP_MANAGER_ERROR_NONE)
- {
- if(app_info_event_cb)
- app_info_event_cb(app_info, event_type, app_info_event_cb_data);
- app_info_destroy(app_info);
- }
-
- req_id = -1;
- event_type = -1;
- }
-
- return APP_MANAGER_ERROR_NONE;
-}
-
-int app_info_set_event_cb(app_manager_app_info_event_cb callback, void *user_data)
-{
- if (callback == NULL)
- {
- return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
- }
-
- if (app_info_event_cb == NULL)
- {
- package_event_listener = pkgmgr_client_new(PC_LISTENING);
-
- if (package_event_listener == NULL)
- {
- return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL);
- }
- }
-
- app_info_event_cb = callback;
- app_info_event_cb_data = user_data;
-
- pkgmgr_client_listen_status(package_event_listener, app_info_package_event_listener_cb, NULL);
-
- return APP_MANAGER_ERROR_NONE;
-}
-
-
-void app_info_unset_event_cb(void)
-{
- if (app_info_event_cb != NULL)
- {
- pkgmgr_client_free(package_event_listener);
- package_event_listener = NULL;
- }
-
- app_info_event_cb = NULL;
- app_info_event_cb_data = NULL;
-}
-
int app_info_filter_create(app_info_filter_h *handle)
{
int retval = 0;
return APP_MANAGER_ERROR_NONE;
}
-int app_manager_set_app_info_event_cb(app_manager_app_info_event_cb callback, void *user_data)
-{
- int retval = app_info_set_event_cb(callback, user_data);
-
- if (retval != APP_MANAGER_ERROR_NONE)
- {
- return app_manager_error(retval, __FUNCTION__, NULL);
- }
- else
- {
- return APP_MANAGER_ERROR_NONE;
- }
-}
-
-void app_manager_unset_app_info_event_cb(void)
-{
- app_info_unset_event_cb();
-}
-
-
int app_manager_foreach_app_info(app_manager_app_info_cb callback, void *user_data)
{
int retval;
{
int retval;
- retval = app_info_get_app_info(app_id, app_info);
+ retval = app_info_create(app_id, app_info);
if (retval != APP_MANAGER_ERROR_NONE)
{
}
}
-int app_manager_get_package(pid_t pid, char **package)
-{
- // TODO: this function must be deprecated
- return app_manager_get_app_id(pid, package);
-}
-
int app_manager_get_app_id(pid_t pid, char **app_id)
{
char buffer[256] = {0, };