Merge pull request #9130 from osmandapp/fix_turn_screen_on
Fix power button for keep screen on
This commit is contained in:
commit
436b7e685e
1 changed files with 7 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue