Merge pull request #655 from alexbakker/phonefactor-error

Show a clearer error message when encountering phonefactor:// URI's
This commit is contained in:
Michael Schättgen 2021-01-13 20:24:26 +01:00 committed by GitHub
commit 3e40cc9c8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 22 deletions

View file

@ -157,7 +157,9 @@ public class ScannerActivity extends AegisActivity implements QrCodeAnalyzer.Lis
}
} catch (GoogleAuthInfoException e) {
e.printStackTrace();
Dialogs.showErrorDialog(this, R.string.read_qr_error, e, ((dialog, which) -> bindPreview(_cameraProvider)));
Dialogs.showErrorDialog(this,
e.isPhoneFactor() ? R.string.read_qr_error_phonefactor : R.string.read_qr_error,
e, ((dialog, which) -> bindPreview(_cameraProvider)));
_cameraProvider.unbindAll();
}
}