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,10 +118,15 @@ public class LockHelper implements SensorEventListener {
|
|||
|
||||
private void lock() {
|
||||
releaseWakeLocks();
|
||||
if (lockUIAdapter != null && !(useSystemScreenTimeout.get() && turnScreenOnPowerButton.get())) {
|
||||
if (lockUIAdapter != null) {
|
||||
boolean useSystemTimeout = useSystemScreenTimeout.get();
|
||||
boolean usePowerButton = useSystemTimeout && turnScreenOnPowerButton.get()
|
||||
|| !useSystemTimeout && turnScreenOnTime.get() == 0 && turnScreenOnPowerButton.get();
|
||||
if (!usePowerButton) {
|
||||
lockUIAdapter.lock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void timedUnlock(final long millis) {
|
||||
uiHandler.removeCallbacks(lockRunnable);
|
||||
|
|
Loading…
Reference in a new issue