Check for null in addition to instanceof Face

We only send a Face object if the client holds the MANAGE_BIOMETRIC
permission. Otherwise we send null. Fixes the issue where clients that
don't have the MANAGE_BIOMETRIC permission don't receive
onAuthenticationSucceeded callback.

Test: Builds
Change-Id: If1742570ebe914d0ba7da17e60655fed3c9a4b39
This commit is contained in:
Kevin Chyn
2018-11-13 12:00:48 -08:00
parent b608ad49f9
commit 628b718831

View File

@@ -485,7 +485,7 @@ public class FaceService extends BiometricServiceBase {
BiometricAuthenticator.Identifier biometric, int userId)
throws RemoteException {
if (mFaceServiceReceiver != null) {
if (biometric instanceof Face) {
if (biometric == null || biometric instanceof Face) {
mFaceServiceReceiver.onAuthenticationSucceeded(deviceId, (Face)biometric);
} else {
Slog.e(TAG, "onAuthenticationSucceeded received non-face biometric");