Use new severity levels and builders
Test: atest SettingsUnitTests Bug: 218817241 Bug: 220367542 Change-Id: I9fa4b22e0ca1ca63e75eab427a7beedd95b744da Merged-In: I9fa4b22e0ca1ca63e75eab427a7beedd95b744da
This commit is contained in:
@@ -25,6 +25,7 @@ import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.safetycenter.SafetyEvent;
|
||||
import android.safetycenter.SafetySourceData;
|
||||
import android.safetycenter.SafetySourceSeverity;
|
||||
import android.safetycenter.SafetySourceStatus;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -40,7 +41,8 @@ public final class BiometricsSafetySource {
|
||||
|
||||
public static final String SAFETY_SOURCE_ID = "Biometrics";
|
||||
|
||||
private BiometricsSafetySource() {}
|
||||
private BiometricsSafetySource() {
|
||||
}
|
||||
|
||||
/** Sets biometric safety data for Safety Center. */
|
||||
public static void setSafetySourceData(Context context, SafetyEvent safetyEvent) {
|
||||
@@ -119,12 +121,12 @@ public final class BiometricsSafetySource {
|
||||
private static void setBiometricSafetySourceData(Context context, String title, String summary,
|
||||
Intent clickIntent, boolean enabled, boolean hasEnrolled, SafetyEvent safetyEvent) {
|
||||
final PendingIntent pendingIntent = createPendingIntent(context, clickIntent);
|
||||
final int statusLevel =
|
||||
enabled && hasEnrolled ? SafetySourceStatus.STATUS_LEVEL_OK
|
||||
: SafetySourceStatus.STATUS_LEVEL_NONE;
|
||||
final int severityLevel =
|
||||
enabled && hasEnrolled ? SafetySourceSeverity.LEVEL_INFORMATION
|
||||
: SafetySourceSeverity.LEVEL_UNSPECIFIED;
|
||||
|
||||
final SafetySourceStatus status = new SafetySourceStatus.Builder(
|
||||
title, summary, statusLevel, pendingIntent).setEnabled(enabled).build();
|
||||
final SafetySourceStatus status = new SafetySourceStatus.Builder(title, summary,
|
||||
severityLevel).setPendingIntent(pendingIntent).setEnabled(enabled).build();
|
||||
final SafetySourceData safetySourceData =
|
||||
new SafetySourceData.Builder().setStatus(status).build();
|
||||
|
||||
|
Reference in New Issue
Block a user