//private TaskCompletionSource<int> _completedSource;

        public IdentifyListener(Func<SpassFingerprint.IIdentifyListener, Task<bool>> startIdentify, IAuthenticationFailedListener failedListener)
        {
            _retriesLeft = 2;
            _startIdentify = startIdentify;
            _failedListener = failedListener;
            _taskCompletionSource = new TaskCompletionSource<FingerprintAuthenticationResult>();
        }
        //private TaskCompletionSource<int> _completedSource;

        public IdentifyListener(Func <SpassFingerprint.IIdentifyListener, Task <bool> > startIdentify, IAuthenticationFailedListener failedListener)
        {
            _retriesLeft          = 2;
            _startIdentify        = startIdentify;
            _failedListener       = failedListener;
            _taskCompletionSource = new TaskCompletionSource <FingerprintAuthenticationResult>();
        }
 public override async Task<FingerprintAuthenticationResult> AuthenticateNoDialogAsync(IAuthenticationFailedListener failedListener, CancellationToken cancellationToken)
 {
     using (cancellationToken.Register(() => _spassFingerprint.CancelIdentify()))
     {
         var identifyListener = new IdentifyListener(StartIdentify, failedListener);
         return await identifyListener.GetTask();
     }
 }
 public override async Task<FingerprintAuthenticationResult> AuthenticateNoDialogAsync(IAuthenticationFailedListener failedListener, CancellationToken cancellationToken)
 {
     using (var cancellationSignal = new CancellationSignal())
     using (cancellationToken.Register(() => cancellationSignal.Cancel()))
     {
         var callback = new FingerprintAuthenticationCallback(failedListener);
         GetService().Authenticate(null, cancellationSignal, FingerprintAuthenticationFlags.None, callback, null);
         return await callback.GetTask();
     }
 }
Ejemplo n.º 5
0
        public override async Task <FingerprintAuthenticationResult> AuthenticateNoDialogAsync(IAuthenticationFailedListener failedListener, CancellationToken cancellationToken)
        {
            var identifyListener = new IdentifyListener(StartIdentify, failedListener);

            using (cancellationToken.Register(() => TryCancel(identifyListener)))
            {
                return(await identifyListener.GetTask());
            }
        }
Ejemplo n.º 6
0
 public override async Task <FingerprintAuthenticationResult> AuthenticateNoDialogAsync(IAuthenticationFailedListener failedListener, CancellationToken cancellationToken)
 {
     using (var cancellationSignal = new CancellationSignal())
         using (cancellationToken.Register(() => cancellationSignal.Cancel()))
         {
             var callback = new FingerprintAuthenticationCallback(failedListener);
             GetService().Authenticate(null, cancellationSignal, FingerprintAuthenticationFlags.None, callback, null);
             return(await callback.GetTask());
         }
 }
 public FingerprintAuthenticationCallback(IAuthenticationFailedListener listener)
 {
     _listener             = listener;
     _taskCompletionSource = new TaskCompletionSource <FingerprintAuthenticationResult>();
 }
Ejemplo n.º 8
0
 public override async Task <SecureFingerprintAuthenticationResult> AuthenticateSecureNoDialogAsync(IAuthenticationFailedListener failedListener, string key, CancellationToken cancellationToken)
 {
     using (var cancellationSignal = new Android.Support.V4.OS.CancellationSignal())
         using (cancellationToken.Register(() => cancellationSignal.Cancel()))
         {
             CryptoObjectHelper crypto = new CryptoObjectHelper();
             var callback = new SecureFingerprintAuthenticationCallback(failedListener, key);
             GetServiceCompat().Authenticate(crypto.BuildCryptoObject(), (int)FingerprintAuthenticationFlags.None, cancellationSignal, callback, null);
             return(await callback.GetTask());
         }
 }
 public FingerprintAuthenticationCallback(IAuthenticationFailedListener listener)
 {
     _listener = listener;
     _taskCompletionSource = new TaskCompletionSource<FingerprintAuthenticationResult>();
 }
 public abstract Task <FingerprintAuthenticationResult> AuthenticateNoDialogAsync(IAuthenticationFailedListener failedListener, CancellationToken cancellationToken);
Ejemplo n.º 11
0
 public SecureFingerprintAuthenticationCallback(IAuthenticationFailedListener listener, string key)
 {
     _key                  = key;
     _listener             = listener;
     _taskCompletionSource = new TaskCompletionSource <SecureFingerprintAuthenticationResult>();
 }
 public abstract Task<FingerprintAuthenticationResult> AuthenticateNoDialogAsync(IAuthenticationFailedListener failedListener, CancellationToken cancellationToken);
Ejemplo n.º 13
0
 public override Task <SecureFingerprintAuthenticationResult> AuthenticateSecureNoDialogAsync(IAuthenticationFailedListener failedListener, string key, CancellationToken cancellationToken)
 {
     throw new System.NotImplementedException();
 }