Refactoring

This commit is contained in:
M66B 2020-01-29 20:02:45 +01:00
parent 34a3b88b49
commit e8c2fe5b9a
1 changed files with 6 additions and 6 deletions

View File

@ -1006,22 +1006,22 @@ public class Helper {
prefs.edit().remove("last_authentication").apply();
}
static void selectKeyAlias(final Activity activity, final LifecycleOwner owner, final String email, final IKeyAlias intf) {
static void selectKeyAlias(final Activity activity, final LifecycleOwner owner, final String alias, final IKeyAlias intf) {
final Context context = activity.getApplicationContext();
final Handler handler = new Handler();
new Thread(new Runnable() {
@Override
public void run() {
if (email != null)
if (alias != null)
try {
if (KeyChain.getPrivateKey(context, email) != null) {
Log.i("Private key available alias=" + email);
if (KeyChain.getPrivateKey(context, alias) != null) {
Log.i("Private key available alias=" + alias);
handler.post(new Runnable() {
@Override
public void run() {
if (owner.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
intf.onSelected(email);
intf.onSelected(alias);
}
});
return;
@ -1063,7 +1063,7 @@ public class Helper {
});
}
},
null, null, null, -1, email);
null, null, null, -1, alias);
}
});
}