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

Commit 4e6417d3 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Always start AuthController

Since device credential is now a first-class citizen, we need to ensure
that SystemUI is always responding to authentication requests. For example,
on devices without biometrics, applications that request authentication
with Authenticators.DEVICE_CREDENTIAL is still a valid request.

Bug: 149795050

Test: Remove /vendor/etc/permissions/android.hardware.fingerprint.xml,
      reboot. Go through CtsVerifier biometric section

Change-Id: I555aa5763deb31011eea46572272327f02470a02
parent 7d07c892
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricPrompt;
@@ -238,10 +237,6 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,

    @Override
    public void start() {
        final PackageManager pm = mContext.getPackageManager();
        if (pm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)
                || pm.hasSystemFeature(PackageManager.FEATURE_FACE)
                || pm.hasSystemFeature(PackageManager.FEATURE_IRIS)) {
        mCommandQueue.addCallback(this);
        mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
        mActivityTaskManager = mInjector.getActivityTaskManager();
@@ -253,7 +248,6 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
            Log.w(TAG, "Unable to register task stack listener", e);
        }
    }
    }

    @Override
    public void showAuthenticationDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver,
+2 −2
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ public class Utils {
     */
    public static boolean isAtLeastStrength(int sensorStrength, int requestedStrength) {
        // Clear out any bits that are not reserved for biometric
        sensorStrength = sensorStrength & Authenticators.BIOMETRIC_MIN_STRENGTH;
        sensorStrength &= Authenticators.BIOMETRIC_MIN_STRENGTH;

        // If the authenticator contains bits outside of the requested strength, it is too weak.
        if ((sensorStrength & ~requestedStrength) != 0) {
@@ -139,7 +139,7 @@ public class Utils {
        }

        for (int i = Authenticators.BIOMETRIC_MAX_STRENGTH;
                i <= requestedStrength; i = i << 1 | 1) {
                i <= requestedStrength; i = (i << 1) | 1) {
            if (i == sensorStrength) {
                return true;
            }
+1 −1
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ public class FingerprintService extends BiometricServiceBase {
        @Override // Binder call
        public long getAuthenticatorId() {
            checkPermission(USE_BIOMETRIC_INTERNAL);
            return FingerprintService.super.getAuthenticatorId();
            return FingerprintService.this.getAuthenticatorId();
        }

        @Override // Binder call