Refactoring

This commit is contained in:
M66B 2019-07-11 08:13:49 +02:00
parent b35a63dff9
commit 6f268c1b56
2 changed files with 6 additions and 2 deletions

View File

@ -147,8 +147,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
if (pm != null && !pm.isInteractive()) {
Log.i("Stop with screen off");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivityBase.this);
prefs.edit().remove("last_authentication").apply();
Helper.clearAuthentication(this);
}
}

View File

@ -751,6 +751,11 @@ public class Helper {
prompt.authenticate(info.build());
}
static void clearAuthentication(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
prefs.edit().remove("last_authentication").apply();
}
// Miscellaneous
static String sanitizeKeyword(String keyword) {