Android Android 6.0 이상에서 기본 Android Fingerprint API를 사용하여 사용자를 인증하는 앱을 작성하고 있습니다. 하나 개의 시나리오에서Android 지문 api - SCREEN_ON 의도 후 FingerprintManager.AuthenticationCallback이 호출되지 않습니다.
- 장치는 GCM 알림을 수신하고 화면이 꺼져 있지만 전화가 잠겨 있지 않은 경우 - 응용 프로그램은 다음과 같은 플래그 activity
실행하여 장치를 "깨어"
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
을 그런 다음 사용자가 손가락으로 인증하도록 요청하는 대화 상자가 표시됩니다. - (FingerprintManager.AuthenticationCallback
에서) 어떤 콜백 함수 -이 경우 여기
fingerprintManager.authenticate(null, cancellationSignal, 0, new FingerprintManager.AuthenticationCallback() {
@Override
public void onAuthenticationError(int errorCode, CharSequence errString) {
super.onAuthenticationError(errorCode, errString);
logger.info("Authentication error " + errorCode + " " + errString);
...
}
@Override
public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
super.onAuthenticationHelp(helpCode, helpString);
logger.info("Authentication help message thrown " + helpCode + " " + helpString);
...
}
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
super.onAuthenticationSucceeded(result);
logger.info("Authentication succeeded");
...
}
/*
* Called when authentication failed but the user can try again
* When called four times - on the next fail onAuthenticationError(FINGERPRINT_ERROR_LOCKOUT)
* will be called
*/
@Override
public void onAuthenticationFailed() {
super.onAuthenticationFailed();
logger.info("Authentication failed");
...
}
}, null);
화면이 켜져있을 때 동일한 코드가 실행이 꺼져 있지만 전원이 때와는 켜져 때 활동에 의해 - 콜백은 호출되지 않습니다.
아이디어가 있으십니까? 미리 감사드립니다.