Last active
October 30, 2016 10:11
-
-
Save flschweiger/d99eb8b1fe6ef8e2c9cabece04e5f8be to your computer and use it in GitHub Desktop.
A class which extends FingerprintManager.AuthenticationCallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthCallbacks extends FingerprintManager.AuthenticationCallback { | |
@Override | |
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) { | |
// Called when a fingerprint is recognized. | |
// The AuthenticationResult contains the CryptoObject which | |
// has been passed to the authenticate() method. | |
Cipher cipher = result.getCryptoObject().getCipher(); | |
// Go on and use the 'unlocked' Cipher object... | |
} | |
@Override | |
public void onAuthenticationError(int errorCode, CharSequence errString) { | |
// Called when an unrecoverable error has been encountered and | |
// the operation is complete. No further callbacks will be | |
// made on this object. | |
} | |
@Override | |
public void onAuthenticationFailed() { | |
// Called when a fingerprint is valid but not recognized. | |
} | |
@Override | |
public void onAuthenticationHelp(int helpCode, CharSequence helpString) { | |
// Called when a recoverable error has been encountered | |
// during authentication. The help string is provided to | |
// give the user guidance for what went wrong, such as | |
// "Sensor dirty, please clean it." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment