Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5215e9f2 authored by Xiao Lei's avatar Xiao Lei Committed by Isak Lilja
Browse files

Do not start fingerprint HAL if it is unstartable

Some users may face the situation that the fingerprint module is
damaged, in which case the user should be able to use device. But
now on HIDL HAL devices, setActiveGroup will thrown a NPE during
boot process.

If the HIDL daemon cannot be found, do not start HAL and complete
this operation directly.

Flag: NA
Test: Manual
Bug: 357894993
Change-Id: Ieb2b5ef9c5f2baa625c8ffab22bf99c5d6cea451
parent 7dbfa89b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -121,6 +121,11 @@ public class FingerprintUpdateActiveUserClient extends StartUserClient<ISession,
            final int targetId = getTargetUserId();
            Slog.d(TAG, "Setting active user: " + targetId);
            HidlToAidlSessionAdapter sessionAdapter = (HidlToAidlSessionAdapter) getFreshDaemon();
            if (sessionAdapter.getIBiometricsFingerprint() == null) {
                Slog.e(TAG, "Failed to setActiveGroup: HIDL daemon is null.");
                mCallback.onClientFinished(this, false /* success */);
                return;
            }
            sessionAdapter.setActiveGroup(targetId, mDirectory.getAbsolutePath());
            mAuthenticatorIds.put(targetId, mHasEnrolledBiometrics
                    ? sessionAdapter.getAuthenticatorIdForUpdateClient() : 0L);
+4 −0
Original line number Diff line number Diff line
@@ -209,6 +209,10 @@ public class HidlToAidlSessionAdapter implements ISession {
        return null;
    }

    protected IBiometricsFingerprint getIBiometricsFingerprint() {
        return mSession.get();
    }

    public long getAuthenticatorIdForUpdateClient() throws RemoteException {
        return mSession.get().getAuthenticatorId();
    }