mirror of https://github.com/M66B/FairEmail.git
Auto cancel biometric prompt
This commit is contained in:
parent
19757af886
commit
115fe43a0f
|
@ -1140,12 +1140,23 @@ public class Helper {
|
|||
|
||||
prompt.authenticate(info.build());
|
||||
|
||||
Runnable cancelPrompt = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
prompt.cancelAuthentication();
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handler.postDelayed(cancelPrompt, 60 * 1000L);
|
||||
|
||||
owner.getLifecycle().addObserver(new LifecycleObserver() {
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
|
||||
public void onDestroy() {
|
||||
prompt.cancelAuthentication();
|
||||
handler.post(cancelled);
|
||||
owner.getLifecycle().removeObserver(this);
|
||||
handler.post(cancelPrompt);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue