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

Commit dbe780f2 authored by Jim Miller's avatar Jim Miller
Browse files

Attempt to fix bug with setActiveGroup() in FingerprintService.

This attempts to fix a crash where setActiveGroup is crashing because
there's no fingerprint hardware.

Attempt to fix bug 21224390

Change-Id: Iff1c6ebb68deb6662fcb4a58248b5a562d9da2c2
parent 4f9fd626
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -626,17 +626,17 @@ public class FingerprintService extends SystemService {
    public void onStart() {
        publishBinderService(Context.FINGERPRINT_SERVICE, new FingerprintServiceWrapper());
        mHalDeviceId = nativeOpenHal();
        if (mHalDeviceId != 0) {
        updateActiveGroup(ActivityManager.getCurrentUser());
        }
        if (DEBUG) Slog.v(TAG, "Fingerprint HAL id: " + mHalDeviceId);
        listenForUserSwitches();
    }

    private void updateActiveGroup(int userId) {
        if (mHalDeviceId != 0) {
            File path = Environment.getUserSystemDirectory(userId);
            nativeSetActiveGroup(userId, path.getAbsolutePath().getBytes());
        }
    }

    private void listenForUserSwitches() {
        try {