Prevent double screen lock intent from firing

Fixes #7475
This commit is contained in:
Moxie Marlinspike 2018-03-08 17:41:27 -08:00
parent a2d04f4806
commit 29fcce23b1

View File

@ -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) {