Fix power button for keep screen on
This commit is contained in:
parent
96bccff515
commit
c69e1104c3
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