#include <tizen.h>
#include <time.h>
-#include <app_service.h>
+#include <app_control.h>
#ifdef __cplusplus
extern "C" {
/**
* @brief Service extra data : the id of the alarm registered
*/
-#define SERVICE_DATA_ALARM_ID "http://tizen.org/appcontrol/data/alarm_id"
+#define APP_CONTROL_DATA_ALARM_ID "http://tizen.org/appcontrol/data/alarm_id"
/**
* @brief Enumerations of error codes for the alarm
*
* @remarks If application is uninstalled after setting an alarm, the alarm is canceled automatically.
*
- * @param[in] service The destination service to perform specific work when the alarm is triggered.
+ * @param[in] app_control The destination app_control to perform specific work when the alarm is triggered.
* @param[in] delay The amount of time before first execution(in second)
* @param[in] period The amount of time between subsequent alarms(in second)
* @param[out] alarm_id The alarm ID uniquely identifies an alarm
* @see alarm_get_scheduled_date()
* @see alarm_get_scheduled_period()
*/
-int alarm_schedule_after_delay(service_h service, int delay, int period, int *alarm_id);
+int alarm_schedule_after_delay(app_control_h app_control, int delay, int period, int *alarm_id);
/**
*
* @remarks If application is uninstalled after setting an alarm, the alarm is canceled automatically.
*
- * @param[in] service The destination service to perform specific work when the alarm is triggered
+ * @param[in] app_control The destination app_control to perform specific work when the alarm is triggered
* @param[in] date The first active alarm time
* @param[in] period The amount of time between subsequent alarms(in second)
* @param[out] alarm_id The alarm ID uniquely identifies an alarm
* @see alarm_get_scheduled_date()
* @see alarm_get_scheduled_period()
*/
-int alarm_schedule_at_date(service_h service, struct tm *date, int period, int *alarm_id);
+int alarm_schedule_at_date(app_control_h app_control, struct tm *date, int period, int *alarm_id);
/**
* To cancel the alarm, call alarm_cancel() with the @alarm_id
* @remarks If application is uninstalled after setting an alarm, the alarm is canceled automatically.
*
- * @param[in] service The destination service to perform specific work when the alarm is triggered.
+ * @param[in] app_control The destination app_control to perform specific work when the alarm is triggered.
* @param[in] date The first active alarm time
* @param[in] week_flag The day of the week, @a week_flag may be a combination of days, like #ALARM_WEEK_FLAG_TUESDAY | #ALARM_WEEK_FLAG_FRIDAY.
* @param[out] alarm_id The alarm ID uniquely identifies an alarm
* @see alarm_get_scheduled_date()
* @see #alarm_week_flag_e
*/
-int alarm_schedule_with_recurrence_week_flag(service_h service, struct tm *date, int week_flag,int *alarm_id);
+int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct tm *date, int week_flag,int *alarm_id);
/**
/**
- * @brief Gets the service to be invoked when the the alarm is triggered
- * @remarks The @a service must be released with service_destroy() by you.
+ * @brief Gets the app_control to be invoked when the the alarm is triggered
+ * @remarks The @a app_control must be released with app_control_destroy() by you.
* @param[in] alarm_id The alarm ID uniquely identifies an alarm
- * @param[out] service The service handle to launch when the alarm is triggered
+ * @param[out] app_control The app_control handle to launch when the alarm is triggered
* @return 0 on success, otherwise a negative error value.
* @retval #ALARM_ERROR_NONE Successful
* @retval #ALARM_ERROR_INVALID_PARAMETER Invalid parameter
* @see alarm_schedule_after_delay()
* @see alarm_schedule_with_recurrence_week_flag()
*/
-int alarm_get_service(int alarm_id, service_h *service);
+int alarm_get_app_control(int alarm_id, app_control_h *app_control);
/**
* @}
#include <app_private.h>
#include <app_alarm.h>
-#include <app_service_private.h>
+#include <app_control_internal.h>
#ifdef LOG_TAG
#undef LOG_TAG
}
-int alarm_schedule_after_delay(service_h service, int delay, int period, int *alarm_id)
+int alarm_schedule_after_delay(app_control_h app_control, int delay, int period, int *alarm_id)
{
bundle *bundle_data;
int result = 0;
- if (service == NULL)
+ if (app_control == NULL)
{
LOGE("INVALID_PARAMETER(0x%08x)", ALARM_ERROR_INVALID_PARAMETER);
return ALARM_ERROR_INVALID_PARAMETER;
}
- if (service_to_bundle(service, &bundle_data) != SERVICE_ERROR_NONE)
+ if (app_control_to_bundle(app_control, &bundle_data) != APP_CONTROL_ERROR_NONE)
{
LOGE("INVALID_PARAMETER(0x%08x)", ALARM_ERROR_INVALID_PARAMETER);
return ALARM_ERROR_INVALID_PARAMETER;
return convert_error_code_to_alarm(__FUNCTION__, result);
}
-int alarm_schedule_at_date(service_h service, struct tm *date, int period_in_second, int *alarm_id)
+int alarm_schedule_at_date(app_control_h app_control, struct tm *date, int period_in_second, int *alarm_id)
{
alarm_date_t internal_time;
alarm_entry_t* alarm_info;
bundle *bundle_data;
int result;
- if (service == NULL || date == NULL)
+ if (app_control == NULL || date == NULL)
{
LOGE("INVALID_PARAMETER(0x%08x)", ALARM_ERROR_INVALID_PARAMETER);
return ALARM_ERROR_INVALID_PARAMETER;
}
- if (service_to_bundle(service, &bundle_data) != SERVICE_ERROR_NONE)
+ if (app_control_to_bundle(app_control, &bundle_data) != APP_CONTROL_ERROR_NONE)
{
LOGE("INVALID_PARAMETER(0x%08x)", ALARM_ERROR_INVALID_PARAMETER);
return ALARM_ERROR_INVALID_PARAMETER;
}
-int alarm_schedule_with_recurrence_week_flag(service_h service, struct tm *date, int week_flag,int *alarm_id)
+int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct tm *date, int week_flag,int *alarm_id)
{
alarm_date_t internal_time;
alarm_entry_t* alarm_info;
bundle *bundle_data;
int result;
- if (service == NULL || date == NULL)
+ if (app_control == NULL || date == NULL)
{
LOGE("INVALID_PARAMETER(0x%08x)", ALARM_ERROR_INVALID_PARAMETER);
return ALARM_ERROR_INVALID_PARAMETER;
}
- if (service_to_bundle(service, &bundle_data) != SERVICE_ERROR_NONE)
+ if (app_control_to_bundle(app_control, &bundle_data) != APP_CONTROL_ERROR_NONE)
{
LOGE("INVALID_PARAMETER(0x%08x)", ALARM_ERROR_INVALID_PARAMETER);
return ALARM_ERROR_INVALID_PARAMETER;
return ALARM_ERROR_NONE;
}
-int alarm_get_service(int alarm_id, service_h *service)
+int alarm_get_app_control(int alarm_id, app_control_h *app_control)
{
bundle *b = NULL;
int error_code = 0;
return ALARM_ERROR_INVALID_PARAMETER;
}
- error_code = service_create_request(b, service);
+ error_code = app_control_create_request(b, app_control);
- if(error_code != SERVICE_ERROR_NONE)
+ if(error_code != APP_CONTROL_ERROR_NONE)
{
return ALARM_ERROR_OUT_OF_MEMORY;
}