it seams a stupid question but i can't find the way to solve it .
I need to light the screen from code and let the SO to dimming and power off the screen .
You can say : use keepalive(false) , but no !!
If i use keepalive(false) the screen is lighted but remaing on , and if i after call releasekeepalive the screen go off immediataly without the SO dimming time,
I don't think that it is possible to do it exactly as you describe. You can call KeepAlive(true) to turn on the screen in bright mode and later release the lock and call KeepAlive(False) to make it dimmed.