當前位置: 首頁>>代碼示例>>Java>>正文


Java FingerprintManager.AuthenticationResult方法代碼示例

本文整理匯總了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);
}
 
開發者ID:sfilmak,項目名稱:MakiLite,代碼行數:19,代碼來源:FingerprintUiHelper.java

示例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");
    }
}
 
開發者ID:aboutZZ,項目名稱:WeChatFingerprintPay,代碼行數:18,代碼來源:FingerprintHandler.java

示例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);
}
 
開發者ID:alex-shpak,項目名稱:keemob,代碼行數:23,代碼來源:FingerprintUiHelper.java

示例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;
    }
}
 
開發者ID:dev-prajwal21,項目名稱:FingerprintAssistant,代碼行數:23,代碼來源:MainActivity.java

示例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();
        }
    };
}
 
開發者ID:uccmawei,項目名稱:FingerprintIdentify,代碼行數:24,代碼來源:FingerprintManagerCompatApi23.java

示例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();
        }
    };
}
 
開發者ID:GigigoGreenLabs,項目名稱:permissionsModule,代碼行數:26,代碼來源:FingerprintManagerCompatApi23.java

示例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);
}
 
開發者ID:NiklasMerz,項目名稱:cordova-plugin-fingerprint-aio,代碼行數:22,代碼來源:FingerprintUiHelper.java

示例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);
    }
}
 
開發者ID:keiji,項目名稱:simple-marshmallow-samples,代碼行數:19,代碼來源:FingerprintActivity.java

示例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();
}
 
開發者ID:noosomii,項目名稱:FingerprintDemo,代碼行數:8,代碼來源:FingerprintHelper.java

示例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
    }
 
開發者ID:anonymous-ME,項目名稱:Automata,代碼行數:11,代碼來源:FingerprintHandler.java

示例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();
}
 
開發者ID:alex-shpak,項目名稱:keemob,代碼行數:8,代碼來源:FingerprintAuthenticationDialogFragment.java

示例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);
        }
    };
}
 
開發者ID:paradoxie,項目名稱:DizzyPassword,代碼行數:31,代碼來源:RxFingerPrinter.java

示例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);
}
 
開發者ID:ivoribeiro,項目名稱:AndroidQuiz,代碼行數:14,代碼來源:FingerprintController.java

示例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();
    }
}
 
開發者ID:Urucas,項目名稱:android-fingerprint-example,代碼行數:12,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:ken5scal,項目名稱:EasyFingerprint,代碼行數:8,代碼來源:EasyFingerprintTest.java


注:本文中的android.hardware.fingerprint.FingerprintManager.AuthenticationResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。