change service_cb to app_control_cb in alarm api. 55/34955/2
authorJiwoong Im <jiwoong.im@samsung.com>
Thu, 5 Feb 2015 02:23:59 +0000 (11:23 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Thu, 5 Feb 2015 02:47:02 +0000 (11:47 +0900)
JIRA ticket : TC-2411

Change-Id: I4ae22909d8903a3aa8941eea3191241d97ef942c
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
include/app_alarm.h
src/alarm.c

index 5dba683..7b3ad0a 100755 (executable)
@@ -20,7 +20,7 @@
 
 #include <tizen.h>
 #include <time.h>
-#include <app_service.h>
+#include <app_control.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -34,7 +34,7 @@ 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
@@ -84,7 +84,7 @@ typedef bool (*alarm_registered_alarm_cb)(int alarm_id, void *user_data);
  *
  * @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
@@ -98,7 +98,7 @@ typedef bool (*alarm_registered_alarm_cb)(int alarm_id, void *user_data);
  * @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);
 
 
 /**
@@ -111,7 +111,7 @@ int alarm_schedule_after_delay(service_h service, int delay, int period, int *al
  *
  * @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
@@ -125,7 +125,7 @@ int alarm_schedule_after_delay(service_h service, int delay, int period, int *al
  * @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);
 
 
 /**
@@ -136,7 +136,7 @@ int alarm_schedule_at_date(service_h service, struct tm *date, int period, int *
  * 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
@@ -152,7 +152,7 @@ int alarm_schedule_at_date(service_h service, struct tm *date, int period, int *
  * @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);
 
 
 /**
@@ -258,10 +258,10 @@ int alarm_get_current_time(struct tm *date);
 
 
 /**
- * @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
@@ -270,7 +270,7 @@ int alarm_get_current_time(struct tm *date);
  * @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);
 
 /**
  * @}
index 6d68d03..374fd04 100755 (executable)
@@ -27,7 +27,7 @@
 
 #include <app_private.h>
 #include <app_alarm.h>
-#include <app_service_private.h>
+#include <app_control_internal.h>
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -187,18 +187,18 @@ int alarm_get_scheduled_period(int alarm_id, int* 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)
 {
        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;
@@ -209,20 +209,20 @@ int alarm_schedule_after_delay(service_h service, int delay, int period, int *al
        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;
@@ -339,20 +339,20 @@ int alarm_get_current_time(struct tm* date)
 }
 
 
-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;
@@ -461,7 +461,7 @@ int alarm_get_scheduled_recurrence_week_flag(int alarm_id, int *week_flag)
        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;
@@ -478,9 +478,9 @@ int alarm_get_service(int alarm_id, service_h *service)
         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;
     }