#include <libintl.h>
#include <bundle.h>
-#include "app_service.h"
+#include "app_control.h"
#ifdef __cplusplus
struct agentcore_ops {
void *data;
/**< Callback data */
- int (*create) (void *);
- int (*terminate) (void *);
- int (*service) (service_h, void *);
+ int (*create) (void *); /**< This callback function is called at the start of the application. */
+ int (*terminate) (void *); /**< This callback function is called once after the main loop of application exits. */
+ int (*app_control) (app_control_h, void *); /**< This callback function is called when other application send the launch request to the application. */
void *reserved[6];
/**< Reserved */
#define __TIZEN_APPFW_SERVICE_APP_H__
#include <tizen.h>
-#include <app_service.h>
+#include <app_control.h>
#include <app.h>
/**
* @brief Called when other application send the launch request to the agent application.
*
- * @param[in] service The handle to the service
+ * @param[in] app_control The handle to the app_control
* @param[in] user_data The user data passed from the callback registration function
* @see service_app_main()
* @see #service_app_event_callback_s
* @see @ref CAPI_SERVICE_MODULE API
*/
-typedef void (*service_app_service_cb) (service_h service, void *user_data);
+typedef void (*service_app_control_cb) (app_control_h app_control, void *user_data);
/**
* @see service_app_main()
* @see service_app_create_cb()
* @see service_app_terminate_cb()
- * @see service_app_service_cb()
+ * @see service_app_control_cb()
*/
typedef struct
{
service_app_create_cb create; /**< This callback function is called at the start of the application. */
service_app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */
- service_app_service_cb service; /**< This callback function is called when another application sends the launch request to the application. */
+ service_app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */
} service_app_lifecycle_callback_s;
*
* @see service_app_create_cb()
* @see service_app_terminate_cb()
- * @see service_app_service_cb()
+ * @see service_app_control_cb()
* @see service_app_exit()
* @see #service_app_lifecycle_callback_s
*/
#include <sysman.h>
#include "aul.h"
#include "appcore-agent.h"
+#include <app_control_internal.h>
#include <dlog.h>
#include <vconf.h>
static struct agent_appcore core;
-extern int service_create_request(bundle *data, service_h *service);
static int __sys_lowmem_post(void *data, void *evt);
static int __sys_lowmem(void *data, void *evt);
static int __sys_lowbatt(void *data, void *evt);
{
int r = 0;
struct agent_priv *svc = data;
- service_h service = NULL;
+ app_control_h app_control = NULL;
_ret_if(svc == NULL);
_ret_if(svc->ops == NULL);
- if (service_create_event(b, &service) != 0)
+ if (app_control_create_event(b, &app_control) != 0)
{
return;
}
switch (event) {
case AGE_REQUEST:
- if (svc->ops->service)
- r = svc->ops->service(service, svc->ops->data);
+ if (svc->ops->app_control)
+ r = svc->ops->app_control(app_control, svc->ops->data);
svc->state = AGS_RUNNING;
break;
/* case AGE_STOP:
/* do nothing */
break;
}
- service_destroy(service);
+ app_control_destroy(app_control);
}
static struct agent_ops s_ops = {
static int service_app_create(void *data);
static int service_app_terminate(void *data);
-static int service_app_reset(service_h service, void *data);
+static int service_app_reset(app_control_h app_control, void *data);
static int service_app_low_memory(void *event_info, void *data);
static int service_app_low_battery(void *event_info, void *data);
.data = &service_app_context,
.create = service_app_create,
.terminate = service_app_terminate,
- .service = service_app_reset,
+ .app_control = service_app_reset,
};
if (argc <= 0 || argv == NULL || callback == NULL)
}
-int service_app_reset(service_h service, void *data)
+int service_app_reset(app_control_h app_control, void *data)
{
service_app_context_h service_app_context = data;
- service_app_service_cb service_cb;
+ service_app_control_cb app_control_cb;
if (service_app_context == NULL)
{
return service_app_error(SERVICE_APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL);
}
- service_cb = service_app_context->callback->service;
+ app_control_cb = service_app_context->callback->app_control;
- if (service_cb != NULL)
+ if (app_control_cb != NULL)
{
- service_cb(service, service_app_context->data);
+ app_control_cb(app_control, service_app_context->data);
}
return SERVICE_APP_ERROR_NONE;