After applying this patch, the appcore supports the background launch
when the application is running in the background.
Some UI applications don't want to be shown the window when getting
the launch request.
Change-Id: I16e1006e67642c39f9774cbc8612e6fe9b7a2c2f
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
static void __set_bg_state(void)
{
static void __set_bg_state(void)
{
+ if (!tz_policy && __init_wl() < 0)
return;
tizen_policy_set_background_state(tz_policy, getpid());
return;
tizen_policy_set_background_state(tz_policy, getpid());
wl_display_roundtrip(dsp);
bg_state = false;
_DBG("bg state: %d", bg_state);
wl_display_roundtrip(dsp);
bg_state = false;
_DBG("bg state: %d", bg_state);
}
static void __appcore_efl_prepare_to_suspend(void *data)
}
static void __appcore_efl_prepare_to_suspend(void *data)
first_launch = FALSE;
} else {
_INFO("[APP %d] App already running, raise the window", _pid);
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)
+ if (!bg_state)
+ wl_raise_win();
}
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]",
ui->name);
}
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]",
ui->name);
ecore_event_handler_del(ui->hlower);
__appcore_timer_del(ui);
ecore_event_handler_del(ui->hlower);
__appcore_timer_del(ui);
static void __set_bg_state(void)
{
static void __set_bg_state(void)
{
+ if (!tz_policy && __init_wl() < 0)
return;
tizen_policy_set_background_state(tz_policy, getpid());
return;
tizen_policy_set_background_state(tz_policy, getpid());
wl_display_roundtrip(dsp);
bg_state = false;
_DBG("bg state: %d", bg_state);
wl_display_roundtrip(dsp);
bg_state = false;
_DBG("bg state: %d", bg_state);
}
static void __do_start(bundle *b)
}
static void __do_start(bundle *b)
- if ((__context.hint & APPCORE_UI_BASE_HINT_BG_LAUNCH_CONTROL) &&
- bg_state) {
+ if (__context.hint & APPCORE_UI_BASE_HINT_BG_LAUNCH_CONTROL) {
bg_launch = bundle_get_val(b, AUL_SVC_K_BG_LAUNCH);
bg_launch = bundle_get_val(b, AUL_SVC_K_BG_LAUNCH);
- if (!bg_launch || strcmp(bg_launch, "enable"))
- __unset_bg_state();
+ if (bg_launch && strcmp(bg_launch, "enable") == 0) {
+ if (!bg_state && __context.state != AS_RUNNING)
+ __set_bg_state();
+ } else {
+ if (bg_state)
+ __unset_bg_state();
+ }
+ if (!bg_state)
+ __raise_win();
}
EXPORT_API int appcore_ui_base_on_receive(aul_type type, bundle *b)
}
EXPORT_API int appcore_ui_base_on_receive(aul_type type, bundle *b)
if (__context.hlower)
ecore_event_handler_del(__context.hlower);
if (__context.hlower)
ecore_event_handler_del(__context.hlower);
elm_shutdown();
/* Check loader case */
elm_shutdown();
/* Check loader case */