Android Q 指纹解锁流程
// Authentation Finger Schedule: (close Screen, Authentation with finger(Success))
// PhoneWindowManager
mKeyguardDelegate.onStartedGoingToSleep(why);
// KeyguardServiceDelegate
mKeyguardService.onStartedGoingToSleep(why);
// KeyguardServiceWrapper
mService.onStartedGoingToSleep(reason);
// KeyguardService
mKeyguardViewMediator.onStartedGoingToSleep(reason);
// KeyguardViewMediator
KeyguardUpdateMonitor.getInstance(mContext).dispatchStartedGoingToSleep(why);
// KeyguardUpdateMonitor#
handleStartedGoingToSleep(msg.arg1);
updateBiometricListeningState();
updateFingerprintListeningState()
startListeningForFingerprint()
mFpm.authenticate(null, mFingerprintCancelSignal, 0, mFingerprintAuthenticationCallback,null, userId);
// FingerprintManager
-> authenticate(
-> (IFingerprintService)mService.authenticate(mToken, sessionId, userId, mServiceReceiver, flags,mContext.getOpPackageName());
-> // FingerprintService# private final class FingerprintServiceWrapper extends IFingerprintService.Stub {
-> public void authenticate(final IBinder token, final long opId, final int groupId,
-> authenticateInternal(
-> startAuthentication(
startClient(client, true /* initiatedByClient */);
// AuthenticationClient#start()
final int result = getDaemonWrapper().authenticate(mOpId, getGroupId());
BiometricServiceBase#protected interface DaemonWrapper { -> int authenticate(long operationId, int groupId) throws RemoteException;
IBiometricsFingerprint daemon = getFingerprintDaemon();
IBiometricsFingerprint daemon = getFingerprintDaemon();
mHalDeviceId = mDaemon.setNotify(mDaemonCallback);
public void onAuthenticated(final long deviceId, final int fingerId, final int groupId,
FingerprintService.super.handleAuthenticated(fp, token);
client.onAuthenticated(identifier, authenticated, token)
// AuthenticationClient#
(BiometricServiceBase.ServiceListener)listener.onAuthenticationSucceeded(getHalDeviceId(), identifier, getTargetUserId());
Or: listener.onAuthenticationFailed(getHalDeviceId());
// FingerprintService#
mFingerprintServiceReceiver.onAuthenticationSucceeded(deviceId, (Fingerprint) biometric, userId);
//FingerprintManager#
mHandler.obtainMessage(MSG_AUTHENTICATION_SUCCEEDED, userId, 0, fp).sendToTarget();
sendAuthenticatedSucceeded((Fingerprint) msg.obj, msg.arg1 /* userId */);
mAuthenticationCallback.onAuthenticationSucceeded(result);
// KeyguardUpdateMonitor
handleFingerprintAuthenticated(result.getUserId());