};
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);
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);
}