Home » Android » Changing SCREEN_OFF_TIMEOUT has no effect

Changing SCREEN_OFF_TIMEOUT has no effect

Posted by: admin November 1, 2017 Leave a comment


I am trying to write a small app that turns off your screen programatically. This is obviously done by setting the SCREEN_OFF_TIMEOUT value to something really low, like 2 seconds, demonstrated in the below code-:

                Settings.System.SCREEN_OFF_TIMEOUT, 2000);

The above code does nothing.

My screen timeout happens after the specified timeout value in the settings ie. 15 seconds of inactivity.

What am I doing wrong ? Is there any other way to tun off your screen programmatically ?

I am on a Samsung Galaxy J7 Max with Android Nougat.