From 5d9519ef6d2f5ecd8cb3aa268880e9bc88df8ea7 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 28 Jul 2020 21:10:09 +0200 Subject: [PATCH] Clear authentication when PIN too --- app/src/main/java/eu/faircode/email/ActivityBase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index a025e966ac..5606b68876 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -29,6 +29,7 @@ import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.os.PowerManager; +import android.text.TextUtils; import android.view.KeyEvent; import android.view.MenuItem; import android.view.View; @@ -345,7 +346,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc Log.i("Stop with screen off"); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); boolean biometrics = prefs.getBoolean("biometrics", false); - if (biometrics) { + String pin = prefs.getString("pin", null); + if (biometrics || !TextUtils.isEmpty(pin)) { Helper.clearAuthentication(this); finish(); }