I have a Tizen 3.0 hybrid app (web + native service), in which the service is expected to turn on the screen and bring the packaged web app to the foreground periodically (every 60 seconds, for example).
In order to schedule this event, the native service calls ecore_timer_add() (from within the service's _on_create_cb) as follows:
app->myTimer = ecore_timer_add(60, ShowApp, NULL);
The ShowApp callback is supposed to bring the packaged web app to the foreground, as follows:
"ecore<2646> lib/ecore/ecore_timer.c:116 _ecore_timer_add() You are calling _ecore_timer_add from outside of the main loop threads. Program cannot run normally"
As a result, the ShowApp function is never called.
I even tried wrapping the ecore_timer_add call inside a function called by ecore_main_loop_thread_safe_call_async, but I got the same error as above.
How can I ensure that ecore_timer_add successfully adds the timer in this service (and calls ShowApp when expected)?
PS. As the end goal is simply to repeatedly turn on the screen and bring the web app to the foreground, I also tried using an Alarm API to accomplish this, but that did not work either:
app_control_h app_control = NULL;
ret = app_control_create(&app_control);
et = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
ret = app_control_set_app_id(app_control, CLIENT_APP_ID);
ret = alarm_schedule_after_delay(app_control, 10, 10, &alarm_id); <== Did not wake up the device/screen to show the app (after 10 seconds)