Languages

Menu
Sites
Language
How to keep the current application in foreground after sleep-mode

My application stays in foreground after display was going to "DISPLAY_DIM" oder "DISPLAY_OFF" mode.

BUT. If application is going to SLEEP-Mode (RESUME) watch-face is always in foreground.
Of cource, I could set activate POWER_LOCK_DISPLAY, but this is increasing the power consmption. Better ideas to keep my application in foreground after SLEEP?

Responses

2 Replies
K Johnson

One idea to keep your app in foreground after coming back from sleep mode is to relaunch your app according to screen state. Would you please try launching your app using AppControl launch request when the display state becomes normal? Hope it'll fulfill your requirement.

Please go through this link for more detail about the idea.

Christof Meerwald

I am actually wondering how the Samsung Health app does it - and from looking at the logs, it looks like there is some hardcoded magic or internal APIs to achieve that:

W/STARTER ( 3026): clock-mgr.c: _check_reserved_apps_status(238) > [_check_reserved_apps_status:238] Current reserved apps status : 1
W/STARTER ( 3026): clock-mgr.c: _pre_lcd_off(871) > [_pre_lcd_off:871] reserved app is running now. raise it.
I/AMD     ( 2477): amd_request.c: __dispatch_request(560) > cmd(APP_GET_PID:43), caller_pid(3026), caller_uid(5001), clifd(24)
W/STARTER ( 3026): clock-mgr.c: _pre_lcd_off(882) > [_pre_lcd_off:882] [com.samsung.shealth.exercising] is now running & will raise when lcd on.
W/STARTER ( 3026): clock-mgr.c: _on_lcd_signal_receive_cb(1055) > [_on_lcd_signal_receive_cb:1055] _on_lcd_signal_receive_cb, 1055, Post LCD off by [timeout]
W/STARTER ( 3026): clock-mgr.c: _post_lcd_off(925) > [_post_lcd_off:925] LCD OFF as reserved app[com.samsung.shealth.exercising] aod mode[0]

And I can't really find the corresponding source code in the Tizen repository - closest I have found was https://git.tizen.org/cgit/apps/native/starter/tree/src/wearable