Turn screen on

Is it somehow possible for an app (or watchface or service) to turn the screen of the watch on? I know I can keep it on by using device_power_request_lock() but can it also be turned on programmatically when it was previously off?

Hi,
Below API will keep screen always on-
efl_util_set_window_screen_mode (win, EFL_UTIL_SCREEN_MODE_ALWAYS_ON );

If you want to screen on/off forcefully, you can use below API-
device_display_change_state ( display_state_e state )

Thanks.

Yes, I can confirm that device_display_change_state() is working for that purpose.

Thank you very much!

Hello, this is what I am looking for, but I am quite confused, where I should put this codeā€¦?

result = device_display_change_state(DISPLAY_STATE_SCREEN_OFF);

for others, this is what help me:

    void MakeScreenOn(int value)
    {
        int ret = DevicePowerRequestLock(value, 0); // type : CPU:0, DisplayNormal:1, DisplayDim:2
    }

    void MakeScreenOff()
    {
        int ret = DevicePowerReleaseLock(1); 
    }

    [DllImport("libcapi-system-device.so.0", EntryPoint = "device_power_request_lock", CallingConvention = CallingConvention.Cdecl)]
    internal static extern int DevicePowerRequestLock(int type, int timeout_ms);

    [DllImport("libcapi-system-device.so.0", EntryPoint = "device_power_release_lock", CallingConvention = CallingConvention.Cdecl)]
    internal static extern int DevicePowerReleaseLock(int type);