if (!alarm_info)
return -1;
+ if (alarm_id) {
+ alarmmgr_remove_alarm(alarm_id);
+ alarm_id = 0;
+ }
+
r = alarmmgr_add_alarm_withcb_with_localtime(alarm_info,
__ambient_tick_cb, data, &alarm_id);
if (r < 0)
_W("__on_change_signal");
bundle_get_str(envelope, "__AMBIENT_MODE__", &mode);
bundle_get_str(envelope, "__AMBIENT_EXTRA__", &extra);
+
+ if ((mode == NULL) || (__context.ambient_mode == atoi(mode))) {
+ _E("invalid state (%d) (%s)", __context.ambient_mode, mode);
+ return 0;
+ }
__context.extra = bundle_decode((bundle_raw *)extra, strlen(extra));
__handling_ambient_mode(atoi(mode), NULL);