From 1e40c861d17a3d2bbe9d8b8ac92137ce1fc17f27 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Tue, 20 Apr 2021 17:02:14 +1000 Subject: [PATCH] make screenlock work within 60s --- .../securesms/preferences/AppProtectionPreferenceFragment.java | 3 ++- .../org/thoughtcrime/securesms/service/KeyCachingService.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/AppProtectionPreferenceFragment.java b/app/src/main/java/org/thoughtcrime/securesms/preferences/AppProtectionPreferenceFragment.java index db9484f9b0..e516916de4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/AppProtectionPreferenceFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/AppProtectionPreferenceFragment.java @@ -102,7 +102,8 @@ public class AppProtectionPreferenceFragment extends CorrectedPreferenceFragment if (duration == 0) { TextSecurePreferences.setScreenLockTimeout(getContext(), 0); } else { - long timeoutSeconds = Math.max(TimeUnit.MILLISECONDS.toSeconds(duration), 60); + long timeoutSeconds = TimeUnit.MILLISECONDS.toSeconds(duration); +// long timeoutSeconds = Math.max(TimeUnit.MILLISECONDS.toSeconds(duration), 60); TextSecurePreferences.setScreenLockTimeout(getContext(), timeoutSeconds); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/service/KeyCachingService.java b/app/src/main/java/org/thoughtcrime/securesms/service/KeyCachingService.java index e1c2350ef1..cde706c6e0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/service/KeyCachingService.java +++ b/app/src/main/java/org/thoughtcrime/securesms/service/KeyCachingService.java @@ -210,7 +210,7 @@ public class KeyCachingService extends Service { boolean passLockActive = timeoutEnabled && !TextSecurePreferences.isPasswordDisabled(context); long screenTimeout = TextSecurePreferences.getScreenLockTimeout(context); - boolean screenLockActive = screenTimeout >= 60 && TextSecurePreferences.isScreenLockEnabled(context); + boolean screenLockActive = screenTimeout >= 0 && TextSecurePreferences.isScreenLockEnabled(context); if (!appVisible && secretSet && (passLockActive || screenLockActive)) { long passphraseTimeoutMinutes = TextSecurePreferences.getPassphraseTimeoutInterval(context);