diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 3e14e6be35..9bc9d3e24b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -1992,7 +1992,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven @Override public void unlock() { - changeKeyguardFlags(true, false); + changeKeyguardFlags(true, true); } @Override diff --git a/OsmAnd/src/net/osmand/plus/helpers/LockHelper.java b/OsmAnd/src/net/osmand/plus/helpers/LockHelper.java index a7dcf6b011..9bf628803a 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/LockHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/LockHelper.java @@ -118,9 +118,11 @@ public class LockHelper implements SensorEventListener { private void lock() { releaseWakeLocks(); - int unlockTime = turnScreenOnTime.get(); if (lockUIAdapter != null) { - if (!(useSystemScreenTimeout.get() && turnScreenOnPowerButton.get()) && unlockTime != 0) { + boolean useSystemTimeout = useSystemScreenTimeout.get(); + boolean usePowerButton = useSystemTimeout && turnScreenOnPowerButton.get() + || !useSystemTimeout && turnScreenOnTime.get() == 0 && turnScreenOnPowerButton.get(); + if (!usePowerButton) { lockUIAdapter.lock(); } }