#define MAX_SERVICE_NAME_LEN 512
#define MAX_PKG_NAME_LEN MAX_SERVICE_NAME_LEN-8
#define MAX_PKG_ID_LEN 512
-#define MAX_APP_ID_LEN 512
+#define MAX_APP_ID_LEN 256
#define MIN_INEXACT_INTERVAL 600
#define REGULAR_UID_MIN 5000
GDBusConnection *conn;
GError *error = NULL;
alarm_id_t *reply_alarm_id = (alarm_id_t *)user_data;
- char *service_name = NULL;
- char *app_unique_name = NULL;
+ char *service_name = "NULL";
+ char *app_unique_name = "NULL";
struct watch_info_t *watch_info;
char log_message[ALARMMGR_LOG_MESSAGE_SIZE] = {0,};
char *due_time_str = ctime(&(info->due_time));
if (due_time_str)
due_time_str[strlen(due_time_str) - 1] = '\0'; /* to avoid new line */
-
- char *timebuf = strdup(ctime(&info->due_time));
- if (timebuf)
- timebuf[strlen(timebuf) - 1] = '\0'; /* to avoid new line */
+ else
+ due_time_str = "NULL";
snprintf(log_message, sizeof(log_message),
"alarmID: %d, uid: %d, caller : %s -> callee : %s, "
info->alarm_id, info->uid, info->app_unique_name, info->callee_pkgid,
info->dst_service_name, info->dst_service_name_mod,
info->alarm_info.alarm_type, info->alarm_info.mode.repeat,
- info->alarm_info.mode.u_interval.interval, info->due_time, timebuf);
-
- if (timebuf)
- free(timebuf);
+ info->alarm_info.mode.u_interval.interval, info->due_time, due_time_str);
_save_module_log(tag, log_message);
#endif /* _APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG */
data = (appid_cache_t *)g_hash_table_lookup(caller_appid_cache_table, GINT_TO_POINTER(pid));
if (data) {
- snprintf(unique_name, MAX_APP_ID_LEN, "%s", data->unique_name);
+ snprintf(unique_name, size, "%s", data->unique_name);
if (is_app)
*is_app = data->is_app;
LOGD("Get cached unique_name: %s, pid:%d", unique_name, pid);
struct timespec cur_time;
gint64 time_sec;
time_t new_time;
- char sender_id[MAX_APP_ID_LEN];
+ char sender_id[MAX_APP_ID_LEN] = "NULL";
char log_message[ALARMMGR_LOG_MESSAGE_SIZE];
g_variant_get(parameters, "(x)", &time_sec);
app_service_name, app_service_name_mod,
NULL, NULL, &return_code)) {
LOGE("Unable to create alarm! return_code[%d]", return_code);
- strncpy(log_tag, "FAIL: CREATE PERIODIC", sizeof(log_tag) - 1);
+ strncpy(log_tag, "FAIL: CREAT PERIOD", sizeof(log_tag) - 1);
snprintf(log_message, sizeof(log_message), "alarmID: %d, uid: %d, pid: %d, duetime: %d-%d-%d %02d:%02d:%02d",
_alarm_id, uid, pid, alarm_info.start.year, alarm_info.start.month,
alarm_info.start.day, alarm_info.start.hour,