Loading src/com/android/settings/biometrics/BiometricsFeatureProvider.java 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.biometrics; import android.safetycenter.SafetySourceIssue; import androidx.annotation.NonNull; import androidx.annotation.Nullable; public interface BiometricsFeatureProvider { /** Returns a SafetySourceIssue for biometrics. */ @Nullable SafetySourceIssue getSafetySourceIssue(@NonNull String sourceId); /** Notifies that the action of an issue is launched */ void notifySafetyIssueActionLaunched(); } src/com/android/settings/biometrics/BiometricsFeatureProviderImpl.java 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.biometrics; import android.safetycenter.SafetySourceIssue; import androidx.annotation.NonNull; import androidx.annotation.Nullable; public class BiometricsFeatureProviderImpl implements BiometricsFeatureProvider { @Nullable @Override public SafetySourceIssue getSafetySourceIssue(@NonNull String sourceId) { return null; } @Override public void notifySafetyIssueActionLaunched() {} } src/com/android/settings/overlay/FeatureFactory.kt +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider import com.android.settings.accessibility.AccessibilitySearchFeatureProvider import com.android.settings.accounts.AccountFeatureProvider import com.android.settings.applications.ApplicationFeatureProvider import com.android.settings.biometrics.BiometricsFeatureProvider import com.android.settings.biometrics.face.FaceFeatureProvider import com.android.settings.biometrics.fingerprint.FingerprintFeatureProvider import com.android.settings.bluetooth.BluetoothFeatureProvider Loading Loading @@ -107,6 +108,11 @@ abstract class FeatureFactory { */ abstract val bluetoothFeatureProvider: BluetoothFeatureProvider /** * Retrieves implementation for Biometrics feature. */ abstract val biometricsFeatureProvider: BiometricsFeatureProvider /** * Retrieves implementation for Face feature. */ Loading src/com/android/settings/overlay/FeatureFactoryImpl.kt +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.settings.accessibility.AccessibilitySearchFeatureProviderImpl import com.android.settings.accounts.AccountFeatureProvider import com.android.settings.accounts.AccountFeatureProviderImpl import com.android.settings.applications.ApplicationFeatureProviderImpl import com.android.settings.biometrics.BiometricsFeatureProvider import com.android.settings.biometrics.BiometricsFeatureProviderImpl import com.android.settings.biometrics.face.FaceFeatureProvider import com.android.settings.biometrics.face.FaceFeatureProviderImpl import com.android.settings.biometrics.fingerprint.FingerprintFeatureProvider Loading Loading @@ -145,6 +147,10 @@ open class FeatureFactoryImpl : FeatureFactory() { BluetoothFeatureProviderImpl() } override val biometricsFeatureProvider: BiometricsFeatureProvider by lazy { BiometricsFeatureProviderImpl() } override val faceFeatureProvider: FaceFeatureProvider by lazy { FaceFeatureProviderImpl() } override val fingerprintFeatureProvider: FingerprintFeatureProvider by lazy { Loading src/com/android/settings/safetycenter/BiometricSourcesUtils.java +32 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.safetycenter.SafetyEvent; import android.safetycenter.SafetySourceData; import android.safetycenter.SafetySourceIssue; import android.safetycenter.SafetySourceStatus; /** Static helpers for setting SafetyCenter data for biometric safety sources. */ Loading @@ -42,6 +43,30 @@ public final class BiometricSourcesUtils { boolean enabled, boolean hasEnrolled, SafetyEvent safetyEvent) { setBiometricSafetySourceData( safetySourceId, context, title, summary, pendingIntent, enabled, hasEnrolled, safetyEvent, null ); } /** Sets data for one of the biometrics sources */ public static void setBiometricSafetySourceData( String safetySourceId, Context context, String title, String summary, PendingIntent pendingIntent, boolean enabled, boolean hasEnrolled, SafetyEvent safetyEvent, SafetySourceIssue safetySourceIssue) { int severityLevel = enabled && hasEnrolled ? SafetySourceData.SEVERITY_LEVEL_INFORMATION Loading @@ -52,8 +77,13 @@ public final class BiometricSourcesUtils { .setPendingIntent(pendingIntent) .setEnabled(enabled) .build(); SafetySourceData safetySourceData = new SafetySourceData.Builder().setStatus(status).build(); SafetySourceData.Builder builder = new SafetySourceData.Builder().setStatus(status); if (safetySourceIssue != null) { builder.addIssue(safetySourceIssue); } SafetySourceData safetySourceData = builder.build(); SafetyCenterManagerWrapper.get() .setSafetySourceData(context, safetySourceId, safetySourceData, safetyEvent); Loading Loading
src/com/android/settings/biometrics/BiometricsFeatureProvider.java 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.biometrics; import android.safetycenter.SafetySourceIssue; import androidx.annotation.NonNull; import androidx.annotation.Nullable; public interface BiometricsFeatureProvider { /** Returns a SafetySourceIssue for biometrics. */ @Nullable SafetySourceIssue getSafetySourceIssue(@NonNull String sourceId); /** Notifies that the action of an issue is launched */ void notifySafetyIssueActionLaunched(); }
src/com/android/settings/biometrics/BiometricsFeatureProviderImpl.java 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.biometrics; import android.safetycenter.SafetySourceIssue; import androidx.annotation.NonNull; import androidx.annotation.Nullable; public class BiometricsFeatureProviderImpl implements BiometricsFeatureProvider { @Nullable @Override public SafetySourceIssue getSafetySourceIssue(@NonNull String sourceId) { return null; } @Override public void notifySafetyIssueActionLaunched() {} }
src/com/android/settings/overlay/FeatureFactory.kt +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider import com.android.settings.accessibility.AccessibilitySearchFeatureProvider import com.android.settings.accounts.AccountFeatureProvider import com.android.settings.applications.ApplicationFeatureProvider import com.android.settings.biometrics.BiometricsFeatureProvider import com.android.settings.biometrics.face.FaceFeatureProvider import com.android.settings.biometrics.fingerprint.FingerprintFeatureProvider import com.android.settings.bluetooth.BluetoothFeatureProvider Loading Loading @@ -107,6 +108,11 @@ abstract class FeatureFactory { */ abstract val bluetoothFeatureProvider: BluetoothFeatureProvider /** * Retrieves implementation for Biometrics feature. */ abstract val biometricsFeatureProvider: BiometricsFeatureProvider /** * Retrieves implementation for Face feature. */ Loading
src/com/android/settings/overlay/FeatureFactoryImpl.kt +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.settings.accessibility.AccessibilitySearchFeatureProviderImpl import com.android.settings.accounts.AccountFeatureProvider import com.android.settings.accounts.AccountFeatureProviderImpl import com.android.settings.applications.ApplicationFeatureProviderImpl import com.android.settings.biometrics.BiometricsFeatureProvider import com.android.settings.biometrics.BiometricsFeatureProviderImpl import com.android.settings.biometrics.face.FaceFeatureProvider import com.android.settings.biometrics.face.FaceFeatureProviderImpl import com.android.settings.biometrics.fingerprint.FingerprintFeatureProvider Loading Loading @@ -145,6 +147,10 @@ open class FeatureFactoryImpl : FeatureFactory() { BluetoothFeatureProviderImpl() } override val biometricsFeatureProvider: BiometricsFeatureProvider by lazy { BiometricsFeatureProviderImpl() } override val faceFeatureProvider: FaceFeatureProvider by lazy { FaceFeatureProviderImpl() } override val fingerprintFeatureProvider: FingerprintFeatureProvider by lazy { Loading
src/com/android/settings/safetycenter/BiometricSourcesUtils.java +32 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.safetycenter.SafetyEvent; import android.safetycenter.SafetySourceData; import android.safetycenter.SafetySourceIssue; import android.safetycenter.SafetySourceStatus; /** Static helpers for setting SafetyCenter data for biometric safety sources. */ Loading @@ -42,6 +43,30 @@ public final class BiometricSourcesUtils { boolean enabled, boolean hasEnrolled, SafetyEvent safetyEvent) { setBiometricSafetySourceData( safetySourceId, context, title, summary, pendingIntent, enabled, hasEnrolled, safetyEvent, null ); } /** Sets data for one of the biometrics sources */ public static void setBiometricSafetySourceData( String safetySourceId, Context context, String title, String summary, PendingIntent pendingIntent, boolean enabled, boolean hasEnrolled, SafetyEvent safetyEvent, SafetySourceIssue safetySourceIssue) { int severityLevel = enabled && hasEnrolled ? SafetySourceData.SEVERITY_LEVEL_INFORMATION Loading @@ -52,8 +77,13 @@ public final class BiometricSourcesUtils { .setPendingIntent(pendingIntent) .setEnabled(enabled) .build(); SafetySourceData safetySourceData = new SafetySourceData.Builder().setStatus(status).build(); SafetySourceData.Builder builder = new SafetySourceData.Builder().setStatus(status); if (safetySourceIssue != null) { builder.addIssue(safetySourceIssue); } SafetySourceData safetySourceData = builder.build(); SafetyCenterManagerWrapper.get() .setSafetySourceData(context, safetySourceId, safetySourceData, safetyEvent); Loading