Fix power button for keep screen on

This commit is contained in:
Vitaliy 2020-06-03 16:41:51 +03:00
parent 96bccff515
commit c69e1104c3

View file

@ -118,8 +118,13 @@ public class LockHelper implements SensorEventListener {
private void lock() {
releaseWakeLocks();
if (lockUIAdapter != null && !(useSystemScreenTimeout.get() && turnScreenOnPowerButton.get())) {
lockUIAdapter.lock();
if (lockUIAdapter != null) {
boolean useSystemTimeout = useSystemScreenTimeout.get();
boolean usePowerButton = useSystemTimeout && turnScreenOnPowerButton.get()
|| !useSystemTimeout && turnScreenOnTime.get() == 0 && turnScreenOnPowerButton.get();
if (!usePowerButton) {
lockUIAdapter.lock();
}
}
}