__check_empty_instance();
}
+static void __control_change_period(const char *class_id, const char *id,
+ bundle *b)
+{
+ appcore_multiwindow_base_instance_h instance_h;
+ widget_base_instance_data *data;
+ double *period = NULL;
+ size_t size;
+ int ret;
+
+ instance_h = appcore_multiwindow_base_instance_find(id);
+ if (!instance_h) {
+ LOGE("context not found: %s", id);
+ return;
+ }
+
+ data = (widget_base_instance_data *)
+ appcore_multiwindow_base_instance_get_extra(instance_h);
+
+ if (!data) {
+ LOGE("could not find instance data: %s", id);
+ return;
+ }
+
+ if (data->periodic_timer) {
+ LOGD("Remove timer!");
+ g_source_remove(data->periodic_timer);
+ data->periodic_timer = 0;
+ }
+
+ ret = bundle_get_byte(b, WIDGET_K_PERIOD, (void **)&period, &size);
+ if (ret == BUNDLE_ERROR_NONE)
+ data->period = *period;
+
+ if (data->period > 0) {
+ LOGD("Restart timer!");
+ data->periodic_timer = g_timeout_add_seconds(data->period,
+ __timeout_cb, data);
+ }
+
+ return;
+}
+
static int __multiwindow_create(void *data)
{
char pkgid[256] = {0, };
__control_pause(class_id, id, b);
else if (strcmp(operation, "terminate") == 0)
__control_destroy(class_id, id, b);
+ else if (strcmp(operation, "period") == 0)
+ __control_change_period(class_id, id, b);
return 0;
}