@ -95,14 +95,10 @@ public class LoginV2Presenter extends BasePresenter implements LoginV2PresenterI
. observeOn ( AndroidSchedulers . mainThread ( ) )
. observeOn ( AndroidSchedulers . mainThread ( ) )
. retryWhen ( errors - > errors . flatMap (
. retryWhen ( errors - > errors . flatMap (
error - > {
error - > {
if ( Build . VERSION . SDK_INT > = Build . VERSION_CODES . M & & error instanceof KeyPermanentlyInvalidatedException ) {
view . showFingerPrintScanner ( false ) ;
gateway . flushBiometricData ( ) ;
}
else if ( error instanceof FingerprintAuthenticationException )
if ( error instanceof FingerprintAuthenticationException )
{
{
view . showFingerPrintScanner ( false ) ;
view . showFingerPrintScanner ( false ) ;
view . showToastMessage ( error . getMessage ( ) ) ;
}
}
else if ( error instanceof SecurityUtils . FailedFingerPrintException | | error instanceof SecurityUtils . SensorNotReadyException ) {
else if ( error instanceof SecurityUtils . FailedFingerPrintException | | error instanceof SecurityUtils . SensorNotReadyException ) {
view . showToastMessage ( error . getMessage ( ) ) ;
view . showToastMessage ( error . getMessage ( ) ) ;
@ -300,8 +296,7 @@ public class LoginV2Presenter extends BasePresenter implements LoginV2PresenterI
@Override
@Override
public void onError ( Throwable e ) {
public void onError ( Throwable e ) {
Log . d ( SecurityUtils . TAG , "Failed : " + e . getMessage ( ) ) ;
gateway . flushBiometricData ( ) ;
}
}
@Override
@Override
@ -315,7 +310,6 @@ public class LoginV2Presenter extends BasePresenter implements LoginV2PresenterI
@Override
@Override
public void onNext ( FingerprintDecResult fingerprintDecResult ) {
public void onNext ( FingerprintDecResult fingerprintDecResult ) {
Log . d ( SecurityUtils . TAG , "Success : " + fingerprintDecResult . toString ( ) ) ;
Log . d ( SecurityUtils . TAG , "Success : " + fingerprintDecResult . toString ( ) ) ;
encUserPassword = fingerprintDecResult . getUserPwd ( ) ;
encUserPassword = fingerprintDecResult . getUserPwd ( ) ;
view . onLoginPerformTask ( ( ) - > loginUser ( fingerprintDecResult . getUserId ( ) , "" ) ) ;
view . onLoginPerformTask ( ( ) - > loginUser ( fingerprintDecResult . getUserId ( ) , "" ) ) ;
@ -323,7 +317,12 @@ public class LoginV2Presenter extends BasePresenter implements LoginV2PresenterI
@Override
@Override
public void onError ( Throwable e ) {
public void onError ( Throwable e ) {
Log . d ( SecurityUtils . TAG , "Failed : " + e . getMessage ( ) ) ;
if ( Build . VERSION . SDK_INT > = Build . VERSION_CODES . M & & e instanceof KeyPermanentlyInvalidatedException ) {
view . showFingerPrintScanner ( false ) ;
gateway . flushBiometricData ( ) ;
view . showPopUpMessage ( getStringfromStringId ( R . string . fingerprint_changed_externally ) , CustomAlertDialog . AlertType . ALERT , null ) ;
}
}
}