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

Commit a95a0543 authored by Joe Bolinger's avatar Joe Bolinger Committed by Android Build Coastguard Worker
Browse files

Refresh biometric preference controllers on lifecycle events.

Fix: 195961101
Test: make RunSettingsRoboTests
Test: manual (enroll via settings and verify preferences enabled after enrolling)

Change-Id: Ie50cd862a42c96eb95f2156a33f34748b2b8b50c
(cherry picked from commit 9e9f1249)
parent 17abee76
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.settings.biometrics.combination;
import android.content.Context;
import android.os.UserHandle;

import androidx.lifecycle.Lifecycle;

/**
 * Preference controller for face settings within the biometrics settings page of work profile,
 * that controls the ability to unlock the phone with face authentication.
@@ -29,6 +31,11 @@ public class BiometricFaceProfileStatusPreferenceController extends
        super(context, key);
    }

    public BiometricFaceProfileStatusPreferenceController(
            Context context, String key, Lifecycle lifecycle) {
        super(context, key, lifecycle);
    }

    @Override
    protected boolean isUserSupported() {
        return mProfileChallengeUserId != UserHandle.USER_NULL
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package com.android.settings.biometrics.combination;

import android.content.Context;

import androidx.lifecycle.Lifecycle;

import com.android.settings.Utils;
import com.android.settings.biometrics.face.FaceStatusPreferenceController;

@@ -30,6 +32,11 @@ public class BiometricFaceStatusPreferenceController extends FaceStatusPreferenc
        super(context, key);
    }

    public BiometricFaceStatusPreferenceController(
            Context context, String key, Lifecycle lifecycle) {
        super(context, key, lifecycle);
    }

    @Override
    protected boolean isDeviceSupported() {
        return Utils.isMultipleBiometricsSupported(mContext) && Utils.hasFaceHardware(mContext);
+7 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.settings.biometrics.combination;
import android.content.Context;
import android.os.UserHandle;

import androidx.lifecycle.Lifecycle;

/**
 * Preference controller for fingerprint settings within the biometrics settings page, that controls
 * the ability to unlock the phone with fingerprint.
@@ -29,6 +31,11 @@ public class BiometricFingerprintProfileStatusPreferenceController extends
        super(context, key);
    }

    public BiometricFingerprintProfileStatusPreferenceController(
            Context context, String key, Lifecycle lifecycle) {
        super(context, key, lifecycle);
    }

    @Override
    protected boolean isUserSupported() {
        return mProfileChallengeUserId != UserHandle.USER_NULL
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package com.android.settings.biometrics.combination;

import android.content.Context;

import androidx.lifecycle.Lifecycle;

import com.android.settings.Utils;
import com.android.settings.biometrics.fingerprint.FingerprintStatusPreferenceController;

@@ -31,6 +33,11 @@ public class BiometricFingerprintStatusPreferenceController extends
        super(context, key);
    }

    public BiometricFingerprintStatusPreferenceController(
            Context context, String key, Lifecycle lifecycle) {
        super(context, key, lifecycle);
    }

    @Override
    protected boolean isDeviceSupported() {
        return Utils.isMultipleBiometricsSupported(mContext)
+12 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.settings.biometrics.combination;
import android.content.Context;
import android.os.UserHandle;

import androidx.lifecycle.Lifecycle;

import com.android.settings.Settings;

/**
@@ -37,6 +39,16 @@ public class CombinedBiometricProfileStatusPreferenceController extends
        super(context, key);
    }

    public CombinedBiometricProfileStatusPreferenceController(
            Context context, Lifecycle lifecycle) {
        super(context, KEY_BIOMETRIC_SETTINGS, lifecycle);
    }

    public CombinedBiometricProfileStatusPreferenceController(
            Context context, String key, Lifecycle lifecycle) {
        super(context, key, lifecycle);
    }

    @Override
    protected boolean isUserSupported() {
        return mProfileChallengeUserId != UserHandle.USER_NULL
Loading