Always set source status, even when null.
This makes sure it erases old data about the source when it's no longer used. Bug: 398185839 Test: Treehugger Flag: com.android.settings.flags.biometrics_onboarding_education Relnote: N/a Change-Id: I94020c99a1e15348868aaef180972439dcb3266f
This commit is contained in:
@@ -29,6 +29,7 @@ import android.safetycenter.SafetyEvent;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.biometrics.BiometricNavigationUtils;
|
||||
import com.android.settings.biometrics.face.FaceStatusUtils;
|
||||
import com.android.settings.flags.Flags;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.RestrictedLockUtils;
|
||||
|
||||
@@ -44,6 +45,10 @@ public final class FaceSafetySource {
|
||||
if (!SafetyCenterManagerWrapper.get().isEnabled(context)) {
|
||||
return;
|
||||
}
|
||||
if (!Flags.biometricsOnboardingEducation()) { // this source is effectively turned off
|
||||
sendNullData(context, safetyEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle private profile case
|
||||
UserManager userManager = UserManager.get(context);
|
||||
@@ -52,9 +57,7 @@ public final class FaceSafetySource {
|
||||
&& userManager.isPrivateProfile()) {
|
||||
// SC always expects a response from the source if the broadcast has been sent for this
|
||||
// source, therefore, we need to send a null SafetySourceData.
|
||||
SafetyCenterManagerWrapper.get()
|
||||
.setSafetySourceData(
|
||||
context, SAFETY_SOURCE_ID, /* safetySourceData= */ null, safetyEvent);
|
||||
sendNullData(context, safetyEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,6 +98,10 @@ public final class FaceSafetySource {
|
||||
return;
|
||||
}
|
||||
|
||||
sendNullData(context, safetyEvent);
|
||||
}
|
||||
|
||||
private static void sendNullData(Context context, SafetyEvent safetyEvent) {
|
||||
SafetyCenterManagerWrapper.get()
|
||||
.setSafetySourceData(
|
||||
context, SAFETY_SOURCE_ID, /* safetySourceData= */ null, safetyEvent);
|
||||
|
Reference in New Issue
Block a user