Reset unlock status if within delay time

This commit is contained in:
tarsin committed 2022-10-20 13:33:50 +08:00
1 parent 3c3ae47511
commit 82ffbf2a1d
1 file changed
+3 -3
@@ -101,9 +101,9 @@ abstract class EhActivity : AppCompatActivity() {
override fun onResume() {
val locked_resume_time = System.currentTimeMillis() / 1000
val locked_delay_time = locked_resume_time - locked_last_leave_time
if (Settings.getSecurity() && locked_delay_time >= Settings.getSecurityDelay() * 60
&& isAuthenticationSupported() && EhApplication.locked
) {
if (locked_delay_time < Settings.getSecurityDelay() * 60) {
EhApplication.locked = false
} else if (Settings.getSecurity() && isAuthenticationSupported() && EhApplication.locked) {
startActivity(Intent(this, SecurityActivity::class.java))
}
super.onResume()