From 29fcce23b1e369c941d0218efa2bbba0b05bdedc Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Thu, 8 Mar 2018 17:41:27 -0800 Subject: [PATCH] Prevent double screen lock intent from firing Fixes #7475 --- .../thoughtcrime/securesms/PassphrasePromptActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java index 70101a8c56..0b5888dc9b 100644 --- a/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java +++ b/src/org/thoughtcrime/securesms/PassphrasePromptActivity.java @@ -81,6 +81,8 @@ public class PassphrasePromptActivity extends PassphraseActivity { private CancellationSignal fingerprintCancellationSignal; private FingerprintListener fingerprintListener; + private boolean authenticated; + @Override public void onCreate(Bundle savedInstanceState) { Log.w(TAG, "onCreate()"); @@ -100,7 +102,7 @@ public class PassphrasePromptActivity extends PassphraseActivity { dynamicTheme.onResume(this); dynamicLanguage.onResume(this); - if (TextSecurePreferences.isScreenLockEnabled(this)) { + if (TextSecurePreferences.isScreenLockEnabled(this) && !authenticated) { resumeScreenLock(); } } @@ -172,6 +174,8 @@ public class PassphrasePromptActivity extends PassphraseActivity { private void handleAuthenticated() { try { + authenticated = true; + MasterSecret masterSecret = MasterSecretUtil.getMasterSecret(this, MasterSecretUtil.UNENCRYPTED_PASSPHRASE); setMasterSecret(masterSecret); } catch (InvalidPassphraseException e) {