Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep screen from locking but maintain dimming functionality?

Tags:

android

I would like to be able to keep the android screen from locking in an application. This is not a marketplace application. It is installed on a dedicated tablet.

The only solution I've found is using the Power Manager and using a WakeLock. This way I can keep the screen from locking, but it also keeps the screen from dimming thus wasting battery.

What I would like is for the screen to dim and turn off the way it always does, but that it is able to wake up when touched and not require the user to press the power button and unlock.

Is this even possible? How would you do something like this?

like image 552
bluediapente Avatar asked Dec 07 '25 04:12

bluediapente


1 Answers

The only solution I've found is using the Power Manager and using a WakeLock. This way I can keep the screen from locking, but it also keeps the screen from dimming thus wasting battery.

You are perhaps using the wrong WakeLock. Please read the PowerManager documentation and try a different WakeLock. There are WakeLock versions that support anything from the screen being off, to the screen being dim, to the screen being normal brightness.

Is this even possible?

If the screen is off, it will not respond to touch events.

like image 163
CommonsWare Avatar answered Dec 08 '25 17:12

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!