Fixed checking for biometric authentication

This commit is contained in:
M66B 2019-10-15 15:11:56 +02:00
parent d1b4a09ba0
commit 77b2a8e792
1 changed files with 13 additions and 7 deletions

View File

@ -105,12 +105,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
prefs.registerOnSharedPreferenceChangeListener(this);
if (!this.getClass().equals(ActivityMain.class) && Helper.shouldAuthenticate(this)) {
finish();
startActivity(
new Intent(this, ActivityMain.class)
.putExtra("intent", intent));
}
checkAuthentication();
super.onCreate(savedInstanceState);
}
@ -141,7 +136,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
Log.i("Contacts permission=" + contacts);
finish();
startActivity(getIntent());
}
} else
checkAuthentication();
super.onResume();
}
@ -208,6 +204,16 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
super.onActivityResult(requestCode, resultCode, data);
}
private void checkAuthentication() {
if (!this.getClass().equals(ActivityMain.class) && Helper.shouldAuthenticate(this)) {
Intent intent = getIntent();
finish();
startActivity(
new Intent(this, ActivityMain.class)
.putExtra("intent", intent));
}
}
@Override
public void startActivity(Intent intent) {
try {