本文整理匯總了Java中android.hardware.fingerprint.FingerprintManager.AuthenticationResult方法的典型用法代碼示例。如果您正苦於以下問題:Java FingerprintManager.AuthenticationResult方法的具體用法?Java FingerprintManager.AuthenticationResult怎麽用?Java FingerprintManager.AuthenticationResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.hardware.fingerprint.FingerprintManager
的用法示例。
在下文中一共展示了FingerprintManager.AuthenticationResult方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
/**
* Called by {@link FingerprintManager} if the authentication succeeded.
*/
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
mIcon.setImageResource(R.drawable.ic_fingerprint_success);
mErrorTextView.setTextColor(
mErrorTextView.getResources().getColor(R.color.success_color, null));
mErrorTextView.setText(
mErrorTextView.getResources().getString(R.string.pin_code_fingerprint_success));
mIcon.postDelayed(new Runnable() {
@Override
public void run() {
mCallback.onAuthenticated();
}
}, SUCCESS_DELAY_MILLIS);
}
示例2: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticationSucceeded(
FingerprintManager.AuthenticationResult result) {
String pwd = WCFPXSharedPreferencesUtil.getPwd(mContext);
//TODO 這裏邏輯有待修改
if (pwd != null && pwd.length() > 0) {
if (mEditText != null) {
mEditText.setText(pwd);
}
else {
showToast("Error: mEditText null");
}
} else {
showToast("Sorry, but you have not set the password in WeChatFingerprintPay yet");
}
}
示例3: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
fingerprintResult = result;
mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
int ic_fingerprint_success_id = mContext.getResources()
.getIdentifier("ic_fingerprint_success", "drawable", FingerprintAuth.packageName);
mIcon.setImageResource(ic_fingerprint_success_id);
int success_color_id = mContext.getResources()
.getIdentifier("success_color", "color", FingerprintAuth.packageName);
mErrorTextView.setTextColor(
mErrorTextView.getResources().getColor(success_color_id, null));
int fingerprint_success_id = mContext.getResources()
.getIdentifier("fingerprint_success", "string", FingerprintAuth.packageName);
mErrorTextView.setText(
mErrorTextView.getResources().getString(fingerprint_success_id));
mIcon.postDelayed(new Runnable() {
@Override
public void run() {
mCallback.onAuthenticated(fingerprintResult);
}
}, SUCCESS_DELAY_MILLIS);
}
示例4: onAuthentication
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthentication(int helpOrErrorCode, CharSequence infoString, FingerprintManager.AuthenticationResult authenticationResult, int authCode) {
switch (authCode) {
case ResponseCode.AUTH_ERROR:
// Show appropriate message
break;
case ResponseCode.AUTH_FAILED:
// Show appropriate message
showToast("Authentication Failed");
break;
case ResponseCode.AUTH_HELP:
// Show appropriate message
break;
case ResponseCode.AUTH_SUCCESS:
// Do whatever you want
showToast("Authentication Success");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
fingerprintResultsHandler.restartListening(fingerPrintHelper.getFingerprintManager(), fingerPrintHelper.getCryptoObject());
}
break;
}
}
示例5: wrapCallback
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
private static FingerprintManager.AuthenticationCallback wrapCallback(final AuthenticationCallback callback) {
return new FingerprintManager.AuthenticationCallback() {
@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
callback.onAuthenticationError(errMsgId, errString);
}
@Override
public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) {
callback.onAuthenticationHelp(helpMsgId, helpString);
}
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
callback.onAuthenticationSucceeded(new AuthenticationResultInternal(unwrapCryptoObject(result.getCryptoObject())));
}
@Override
public void onAuthenticationFailed() {
callback.onAuthenticationFailed();
}
};
}
示例6: wrapCallback
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
private static FingerprintManager.AuthenticationCallback wrapCallback(
final AuthenticationCallback callback) {
return new FingerprintManager.AuthenticationCallback() {
@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
callback.onAuthenticationError(errMsgId, errString);
}
@Override
public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) {
callback.onAuthenticationHelp(helpMsgId, helpString);
}
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
callback.onAuthenticationSucceeded(new AuthenticationResultInternal(
unwrapCryptoObject(result.getCryptoObject())));
}
@Override
public void onAuthenticationFailed() {
callback.onAuthenticationFailed();
}
};
}
示例7: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
int ic_fingerprint_success_id = mContext.getResources()
.getIdentifier("ic_fingerprint_success", "drawable", Fingerprint.packageName);
mIcon.setImageResource(ic_fingerprint_success_id);
int success_color_id = mContext.getResources()
.getIdentifier("success_color", "color", Fingerprint.packageName);
mErrorTextView.setTextColor(
mErrorTextView.getResources().getColor(success_color_id, null));
int fingerprint_success_id = mContext.getResources()
.getIdentifier("fingerprint_success", "string", Fingerprint.packageName);
mErrorTextView.setText(
mErrorTextView.getResources().getString(fingerprint_success_id));
mIcon.postDelayed(new Runnable() {
@Override
public void run() {
mCallback.onAuthenticated();
}
}, SUCCESS_DELAY_MILLIS);
}
示例8: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
super.onAuthenticationSucceeded(result);
Log.d(TAG, "onAuthenticationSucceeded");
mTextView.append("指紋認証に成功しました\n");
mTextView.append("復號処理中です...\n");
try {
// 復號処理
byte[] plain = result.getCryptoObject().getCipher().doFinal(mEncryptedData);
mTextView.append("復號されたデータ: ");
mTextView.append(new String(plain, CHARSET));
} catch (UnsupportedEncodingException | IllegalBlockSizeException | BadPaddingException e) {
Log.d(TAG, e.getClass().getSimpleName(), e);
}
}
示例9: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
super.onAuthenticationSucceeded(result);
Toast.makeText(context,
"Authentication succeeded.",
Toast.LENGTH_LONG).show();
}
示例10: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
//onAuthenticationSucceeded is called when a fingerprint has been successfully matched to one of the fingerprints stored on the user’s device//
public void onAuthenticationSucceeded(
FingerprintManager.AuthenticationResult result) {
Intent intent = new Intent(context, Main.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
login_activity.finish(); // call this to finish the current activity
}
示例11: onAuthenticated
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticated(FingerprintManager.AuthenticationResult result) {
// Callback from FingerprintUiHelper. Let the activity know that authentication was
// successful.
FingerprintAuth.onAuthenticated(true /* withFingerprint */, result);
dismissAllowingStateLoss();
}
示例12: initManager
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.M)
private void initManager() {
mCancellationSignal = new CancellationSignal();
manager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
mKeyManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
mSelfCancelled = new FingerprintManager.AuthenticationCallback() {
@Override
public void onAuthenticationError(int errorCode, CharSequence errString) {
//多次指紋密碼驗證錯誤後,進入此方法;並且,不能短時間內調用指紋驗證
publishSubject.onError(new FPerException(FINGERPRINTERS_FAILED_ERROR));
mCancellationSignal.cancel();
}
@Override
public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
}
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
publishSubject.onNext(true);
}
@Override
public void onAuthenticationFailed() {
publishSubject.onNext(false);
}
};
}
示例13: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
mInfoImageView.setBackground(null);
mInfoImageView.setImageResource(R.drawable.vt_fingerprint_success);
mInfoTextView.setText(mContext.getString(R.string.setup_fingerprint_sucesso));
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
mCallBack.fingerprintAuthResult(true);
}
}, 500);
}
示例14: onAuthenticationSucceeded
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
super.onAuthenticationSucceeded(result);
Log.i("finger print", "emitted");
if(backdoor || result.getCryptoObject().equals(this.cryptoObject)) {
dialog.dismiss();
openSecretActivity();
}else{
Toast.makeText(MainActivity.this, R.string.user_not_authenticated, Toast.LENGTH_LONG).show();
}
}
示例15: whenAuthenticationSucceeded_callback_is_called
import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Test
@TargetApi(Build.VERSION_CODES.M)
public void whenAuthenticationSucceeded_callback_is_called() throws NoSuchPaddingException, NoSuchAlgorithmException {
FingerprintManager.AuthenticationResult result = notNull(FingerprintManager.AuthenticationResult.class);
easyFingerprint.onAuthenticationSucceeded(result);
verify(mockedCallback).authenticated(result);
}