Fix turn screen on
This commit is contained in:
parent
6dde05d297
commit
1a4970fbbc
2 changed files with 4 additions and 6 deletions
|
@ -1977,11 +1977,12 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
if (enable) {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
|
||||
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
|
||||
setKeepScreenOn(true);
|
||||
} else {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
|
||||
}
|
||||
setKeepScreenOn(forceKeepScreenOn);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lock() {
|
||||
|
|
|
@ -118,13 +118,10 @@ public class LockHelper implements SensorEventListener {
|
|||
|
||||
private void lock() {
|
||||
releaseWakeLocks();
|
||||
int unlockTime = turnScreenOnTime.get();
|
||||
if (lockUIAdapter != null) {
|
||||
if (!(useSystemScreenTimeout.get() && turnScreenOnPowerButton.get()) && unlockTime != 0) {
|
||||
if (lockUIAdapter != null && !(useSystemScreenTimeout.get() && turnScreenOnPowerButton.get())) {
|
||||
lockUIAdapter.lock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void timedUnlock(final long millis) {
|
||||
uiHandler.removeCallbacks(lockRunnable);
|
||||
|
|
Loading…
Reference in a new issue