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

Commit 5596642a authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Check FEATURE_FINGERPRINT before trying to getSystemService

Fixes: 65838275

Test: Tested on Ryu/Walleye, the stack trace is not seen anymore
Change-Id: I7b12fdca81d5f2523dea5a981fcf1daa69254eb4
parent ce741680
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.ActivityThread;
import android.app.Application;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Binder;
import android.os.IBinder;
@@ -762,6 +763,10 @@ public class KeyStore {
    }

    private long getFingerprintOnlySid() {
        final PackageManager packageManager = mContext.getPackageManager();
        if (!packageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
            return 0;
        }
        FingerprintManager fingerprintManager = mContext.getSystemService(FingerprintManager.class);
        if (fingerprintManager == null) {
            return 0;