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

Commit 8a023007 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Merge "Add configurable ignore-list for acquired messaging" into...

Merge "Merge "Merge "Add configurable ignore-list for acquired messaging" into qt-dev am: 3a0748c2" into qt-dev-plus-aosp am: c26666c1"
parents a9b990e3 097e3869
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -4057,4 +4057,34 @@

    <!-- Which binder services to include in incident reports containing restricted images. -->
    <string-array name="config_restrictedImagesServices" translatable="false"/>

    <!-- Messages that should not be shown to the user during face auth enrollment. This should be
         used to hide messages that may be too chatty or messages that the user can't do much about.
         Entries are defined in android.hardware.biometrics.face@1.0 types.hal -->
    <integer-array name="config_face_acquire_enroll_ignorelist" translatable="false" >
    </integer-array>
    <!-- Same as the above, but are defined by vendorCodes -->
    <integer-array name="config_face_acquire_vendor_enroll_ignorelist" translatable="false" >
    </integer-array>

    <!-- Messages that should not be shown to the user during face authentication, on keyguard.
         This includes both lockscreen and bouncer. This should be used to hide messages that may be
         too chatty or messages that the user can't do much about. Entries are defined in
         android.hardware.biometrics.face@1.0 types.hal -->
    <integer-array name="config_face_acquire_keyguard_ignorelist" translatable="false" >
    </integer-array>
    <!-- Same as the above, but are defined by vendorCodes -->
    <integer-array name="config_face_acquire_vendor_keyguard_ignorelist" translatable="false" >
    </integer-array>

    <!-- Messages that should not be shown to the user during face authentication, on
     BiometricPrompt. This should be used to hide messages that may be too chatty or messages that
     the user can't do much about. Entries are defined in
     android.hardware.biometrics.face@1.0 types.hal -->
    <integer-array name="config_face_acquire_biometricprompt_ignorelist" translatable="false" >
    </integer-array>
    <!-- Same as the above, but are defined by vendorCodes -->
    <integer-array name="config_face_acquire_vendor_biometricprompt_ignorelist" translatable="false" >
    </integer-array>

</resources>
+7 −0
Original line number Diff line number Diff line
@@ -2570,6 +2570,13 @@
  <java-symbol type="string" name="face_authenticated_no_confirmation_required" />
  <java-symbol type="string" name="face_authenticated_confirmation_required" />

  <java-symbol type="array" name="config_face_acquire_enroll_ignorelist" />
  <java-symbol type="array" name="config_face_acquire_vendor_enroll_ignorelist" />
  <java-symbol type="array" name="config_face_acquire_keyguard_ignorelist" />
  <java-symbol type="array" name="config_face_acquire_vendor_keyguard_ignorelist" />
  <java-symbol type="array" name="config_face_acquire_biometricprompt_ignorelist" />
  <java-symbol type="array" name="config_face_acquire_vendor_biometricprompt_ignorelist" />

  <!-- Face config -->
  <java-symbol type="integer" name="config_faceMaxTemplatesPerUser" />

+4 −4
Original line number Diff line number Diff line
@@ -63,11 +63,11 @@ public abstract class AuthenticationClient extends ClientMonitor {
     */
    public abstract boolean shouldFrameworkHandleLockout();

    public AuthenticationClient(Context context, Metrics metrics,
    public AuthenticationClient(Context context, Constants constants,
            BiometricServiceBase.DaemonWrapper daemon, long halDeviceId, IBinder token,
            BiometricServiceBase.ServiceListener listener, int targetUserId, int groupId, long opId,
            boolean restricted, String owner, int cookie, boolean requireConfirmation) {
        super(context, metrics, daemon, halDeviceId, token, listener, targetUserId, groupId,
        super(context, constants, daemon, halDeviceId, token, listener, targetUserId, groupId,
                restricted, owner, cookie);
        mOpId = opId;
        mRequireConfirmation = requireConfirmation;
@@ -126,7 +126,7 @@ public abstract class AuthenticationClient extends ClientMonitor {

        final BiometricServiceBase.ServiceListener listener = getListener();

        mMetricsLogger.action(mMetrics.actionBiometricAuth(), authenticated);
        mMetricsLogger.action(mConstants.actionBiometricAuth(), authenticated);
        boolean result = false;

        try {
@@ -225,7 +225,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
            final int result = getDaemonWrapper().authenticate(mOpId, getGroupId());
            if (result != 0) {
                Slog.w(getLogTag(), "startAuthentication failed, result=" + result);
                mMetricsLogger.histogram(mMetrics.tagAuthStartError(), result);
                mMetricsLogger.histogram(mConstants.tagAuthStartError(), result);
                onError(getHalDeviceId(), BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
                        0 /* vendorCode */);
                return result;
+7 −7
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ public abstract class BiometricServiceBase extends SystemService
    /**
     * @return the metrics constants for a biometric implementation.
     */
    protected abstract Metrics getMetrics();
    protected abstract Constants getConstants();

    /**
     * @param userId
@@ -220,7 +220,7 @@ public abstract class BiometricServiceBase extends SystemService
        public AuthenticationClientImpl(Context context, DaemonWrapper daemon, long halDeviceId,
                IBinder token, ServiceListener listener, int targetUserId, int groupId, long opId,
                boolean restricted, String owner, int cookie, boolean requireConfirmation) {
            super(context, getMetrics(), daemon, halDeviceId, token, listener, targetUserId,
            super(context, getConstants(), daemon, halDeviceId, token, listener, targetUserId,
                    groupId, opId, restricted, owner, cookie, requireConfirmation);
        }

@@ -283,7 +283,7 @@ public abstract class BiometricServiceBase extends SystemService
                IBinder token, ServiceListener listener, int userId, int groupId,
                byte[] cryptoToken, boolean restricted, String owner,
                final int[] disabledFeatures) {
            super(context, getMetrics(), daemon, halDeviceId, token, listener,
            super(context, getConstants(), daemon, halDeviceId, token, listener,
                    userId, groupId, cryptoToken, restricted, owner, getBiometricUtils(),
                    disabledFeatures);
        }
@@ -302,7 +302,7 @@ public abstract class BiometricServiceBase extends SystemService
                DaemonWrapper daemon, long halDeviceId, IBinder token,
                ServiceListener listener, int templateId, int groupId, int userId,
                boolean restricted, String owner) {
            super(context, getMetrics(), daemon, halDeviceId, token, listener, templateId, groupId,
            super(context, getConstants(), daemon, halDeviceId, token, listener, templateId, groupId,
                    userId, restricted, owner, getBiometricUtils());
        }

@@ -329,7 +329,7 @@ public abstract class BiometricServiceBase extends SystemService
                ServiceListener listener, int groupId, int userId, boolean restricted,
                String owner, List<? extends BiometricAuthenticator.Identifier> enrolledList,
                BiometricUtils utils) {
            super(context, getMetrics(), daemon, halDeviceId, token, listener, groupId, userId,
            super(context, getConstants(), daemon, halDeviceId, token, listener, groupId, userId,
                    restricted, owner);
            mEnrolledList = enrolledList;
            mUtils = utils;
@@ -655,7 +655,7 @@ public abstract class BiometricServiceBase extends SystemService
    @Override
    public void serviceDied(long cookie) {
        Slog.e(getTag(), "HAL died");
        mMetricsLogger.count(getMetrics().tagHalDied(), 1);
        mMetricsLogger.count(getConstants().tagHalDied(), 1);
        mHALDeathCount++;
        mCurrentUserId = UserHandle.USER_NULL;
        handleError(getHalDeviceId(), BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE,
@@ -845,7 +845,7 @@ public abstract class BiometricServiceBase extends SystemService
        }

        mHandler.post(() -> {
            mMetricsLogger.histogram(getMetrics().tagAuthToken(), opId != 0L ? 1 : 0);
            mMetricsLogger.histogram(getConstants().tagAuthToken(), opId != 0L ? 1 : 0);

            // Get performance stats object for this user.
            HashMap<Integer, PerformanceStats> pmap
+30 −5
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public abstract class ClientMonitor extends LoggableMonitor implements IBinder.D
    private final int mCookie;

    protected final MetricsLogger mMetricsLogger;
    protected final Metrics mMetrics;
    protected final Constants mConstants;

    protected boolean mAlreadyCancelled;
    protected boolean mAlreadyDone;
@@ -80,12 +80,12 @@ public abstract class ClientMonitor extends LoggableMonitor implements IBinder.D
     * permission
     * @param owner name of the client that owns this
     */
    public ClientMonitor(Context context, Metrics metrics,
    public ClientMonitor(Context context, Constants constants,
            BiometricServiceBase.DaemonWrapper daemon, long halDeviceId, IBinder token,
            BiometricServiceBase.ServiceListener listener, int userId, int groupId,
            boolean restricted, String owner, int cookie) {
        mContext = context;
        mMetrics = metrics;
        mConstants = constants;
        mDaemon = daemon;
        mHalDeviceId = halDeviceId;
        mToken = token;
@@ -108,7 +108,7 @@ public abstract class ClientMonitor extends LoggableMonitor implements IBinder.D
    }

    protected String getLogTag() {
        return mMetrics.logTag();
        return mConstants.logTag();
    }

    public int getCookie() {
@@ -145,6 +145,31 @@ public abstract class ClientMonitor extends LoggableMonitor implements IBinder.D
    public abstract boolean onEnumerationResult(
            BiometricAuthenticator.Identifier identifier, int remaining);

    public int[] getAcquireIgnorelist() {
        return new int[0];
    }
    public int[] getAcquireVendorIgnorelist() {
        return new int[0];
    }

    private boolean blacklistContains(int acquiredInfo, int vendorCode) {
        if (acquiredInfo == mConstants.acquireVendorCode()) {
            for (int i = 0; i < getAcquireVendorIgnorelist().length; i++) {
                if (getAcquireVendorIgnorelist()[i] == vendorCode) {
                    if (DEBUG) Slog.v(getLogTag(), "Ignoring vendor message: " + vendorCode);
                    return true;
                }
            }
        } else {
            for (int i = 0; i < getAcquireIgnorelist().length; i++) {
                if (getAcquireIgnorelist()[i] == acquiredInfo) {
                    if (DEBUG) Slog.v(getLogTag(), "Ignoring message: " + acquiredInfo);
                    return true;
                }
            }
        }
        return false;
    }

    public boolean isAlreadyDone() {
        return mAlreadyDone;
@@ -160,7 +185,7 @@ public abstract class ClientMonitor extends LoggableMonitor implements IBinder.D
        super.logOnAcquired(mContext, acquiredInfo, vendorCode, getTargetUserId());
        if (DEBUG) Slog.v(getLogTag(), "Acquired: " + acquiredInfo + " " + vendorCode);
        try {
            if (mListener != null) {
            if (mListener != null && !blacklistContains(acquiredInfo, vendorCode)) {
                mListener.onAcquired(getHalDeviceId(), acquiredInfo, vendorCode);
            }
            return false; // acquisition continues...
Loading