Changes registering ambient tick alarm to withcb alarm 30/233330/2
authorInkyun Kil <inkyun.kil@samsung.com>
Thu, 14 May 2020 02:36:41 +0000 (11:36 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Thu, 14 May 2020 23:39:11 +0000 (08:39 +0900)
Change-Id: Ibbfcac47a81dd28dbdf8b6511a29b16f8e8f1bb0
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
src/base/watch_base.c

index 62c63bf..b27c85a 100755 (executable)
@@ -354,7 +354,6 @@ static int __set_ambient_tick_cb(void *data)
        };
        int r;
        struct ambient_tick_type_info info;
-       char appid_buf[APPID_BUFFER_MAX] = {0, };
        alarm_entry_t *alarm_info = NULL;
 
        _watch_base_time_get_timeinfo(&timeinfo);
@@ -369,19 +368,10 @@ static int __set_ambient_tick_cb(void *data)
                if (!alarm_info)
                        return -1;
 
-               alarmmgr_set_cb(__ambient_tick_cb, data);
-
-               /* Set a next alarm */
-               if (aul_app_get_appid_bypid(getpid(), appid_buf, sizeof(appid_buf))
-                       != AUL_R_OK) {
-                       LOGE("Failed to get appid (%d)", getpid());
-                       alarmmgr_free_alarm(alarm_info);
-                       return -1;
-               }
-
-               r = alarmmgr_add_alarm_with_localtime(alarm_info, appid_buf, &alarm_id);
+               r = alarmmgr_add_alarm_withcb_with_localtime(alarm_info,
+                       __ambient_tick_cb, data, &alarm_id);
                if (r < 0)
-                       LOGE("fail to alarmmgr_add_alarm_with_localtime : error_code : %d", r);
+                       LOGE("fail to alarmmgr_add_alarm : error_code : %d", r);
                __on_ambient_tick(&timeinfo, data);
        }