Update ParentalControlsUtils to use a new utility that is able to retrieve the component for the EnforcedAdmin.

Bug: 382038943
Flag: android.app.supervision.flags.deprecate_dpm_supervision_apis
Test: atest ParentalControlsUtilsTest
Change-Id: Ic2ecf644f2966bbe2e29c4a691db9e004f0d6a0e
This commit is contained in:
Vitor Carvalho
2025-03-11 13:20:47 +00:00
parent 1ec32b9cd5
commit 89287233f1
7 changed files with 42 additions and 26 deletions

View File

@@ -178,6 +178,7 @@ public class FaceSafetySourceTest {
@EnableFlags(android.app.supervision.flags.Flags.FLAG_DEPRECATE_DPM_SUPERVISION_APIS)
public void setSafetySourceData_withFaceNotEnrolled_whenSupervisionIsOn_setsData() {
when(mSupervisionManager.isSupervisionEnabledForUser(USER_ID)).thenReturn(true);
when(mSupervisionManager.getActiveSupervisionAppPackage()).thenReturn("supervision.pkg");
when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
when(mFaceManager.isHardwareDetected()).thenReturn(true);
when(mFaceManager.hasEnrolledTemplates(anyInt())).thenReturn(false);
@@ -228,6 +229,7 @@ public class FaceSafetySourceTest {
@EnableFlags(android.app.supervision.flags.Flags.FLAG_DEPRECATE_DPM_SUPERVISION_APIS)
public void setSafetySourceData_withFaceEnrolled_whenSupervisionIsOn_setsData() {
when(mSupervisionManager.isSupervisionEnabledForUser(USER_ID)).thenReturn(true);
when(mSupervisionManager.getActiveSupervisionAppPackage()).thenReturn("supervision.pkg");
when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
when(mFaceManager.isHardwareDetected()).thenReturn(true);
when(mFaceManager.hasEnrolledTemplates(anyInt())).thenReturn(true);