+static void __set_bg_state(void)
+{
+ if (__init_wl() < 0)
+ return;
+
+ tizen_policy_set_background_state(tz_policy, getpid());
+ wl_display_roundtrip(dsp);
+ bg_state = true;
+ _DBG("bg state: %d", bg_state);
+}
+
+static void __unset_bg_state(void)
+{
+ if (!tz_policy)
+ return;
+
+ tizen_policy_unset_background_state(tz_policy, getpid());
+ wl_display_roundtrip(dsp);
+ bg_state = false;
+ _DBG("bg state: %d", bg_state);
+ __finish_wl();
+}
+
+static void __appcore_efl_prepare_to_suspend(void *data)
+{
+ struct ui_priv *ui = (struct ui_priv *)data;
+ struct sys_op *op = NULL;
+ int suspend = APPCORE_SUSPENDED_STATE_WILL_ENTER_SUSPEND;
+
+ if (ui->app_core && !ui->app_core->allowed_bg && !ui->app_core->suspended_state) {
+ op = &ui->app_core->sops[SE_SUSPENDED_STATE];
+ if (op && op->func)
+ op->func((void *)&suspend, op->data); /* calls c-api handler */
+
+ ui->app_core->suspended_state = true;
+ }
+ _DBG("[__SUSPEND__]");
+}
+
+static void __appcore_efl_exit_from_suspend(void *data)
+{
+ struct ui_priv *ui = (struct ui_priv *)data;
+ struct sys_op *op = NULL;
+ int suspend = APPCORE_SUSPENDED_STATE_DID_EXIT_FROM_SUSPEND;
+
+ if (ui->app_core && !ui->app_core->allowed_bg && ui->app_core->suspended_state) {
+ op = &ui->app_core->sops[SE_SUSPENDED_STATE];
+ if (op && op->func)
+ op->func((void *)&suspend, op->data); /* calls c-api handler */
+
+ ui->app_core->suspended_state = false;
+ }
+ _DBG("[__SUSPEND__]");
+}
+
+static void __appcore_efl_update_requested(void *data)
+{
+ struct ui_priv *ui = (struct ui_priv *)data;
+ struct sys_op *op;
+ int dummy = 0;
+
+ if (ui->app_core) {
+ op = &ui->app_core->sops[SE_UPDATE_REQUESTED];
+ if (op && op->func)
+ op->func((void *)&dummy, op->data);
+ }
+ _DBG("[__UPDATE_REQUESTED__]");
+}