static void __set_bg_state(void)
{
- if (__init_wl() < 0)
+ if (!tz_policy && __init_wl() < 0)
return;
tizen_policy_set_background_state(tz_policy, getpid());
wl_display_roundtrip(dsp);
bg_state = false;
_DBG("bg state: %d", bg_state);
- __finish_wl();
}
#ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
first_launch = FALSE;
} else {
_INFO("[APP %d] App already running, raise the window", _pid);
- if (bg_state) {
- bg_launch = bundle_get_val(b, AUL_SVC_K_BG_LAUNCH);
- if (!bg_launch || strcmp(bg_launch, "enable"))
+ bg_launch = bundle_get_val(b, AUL_SVC_K_BG_LAUNCH);
+ if (bg_launch && strcmp(bg_launch, "enable") == 0) {
+ if (!bg_state && ui->state != AS_RUNNING)
+ __set_bg_state();
+ } else {
+ if (bg_state)
__unset_bg_state();
}
+
+ if (!bg_state) {
#ifdef X11
- x_raise_win(getpid());
+ x_raise_win(getpid());
#else
- wl_raise_win();
+ wl_raise_win();
#endif
+ }
}
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]",
ui->name);
#endif
__appcore_timer_del(ui);
-
+ __finish_wl();
elm_shutdown();
/* Check loader case */