Merge "Set up correct ComponentName for test mode of Parental Controls" into tm-dev am: d191a16c54
am: 8ef0f87dcc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17504393 Change-Id: Ia8f86fce06aa6f09c1d86fb122afc91c67fdced2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -41,16 +41,19 @@ public class ParentalControlsUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Public version that enables test paths, see
|
* Public version that enables test paths, see
|
||||||
* {@link android.hardware.biometrics.ParentalControlsUtilsInternal#isTestModeEnabled(Context)}
|
* {@link android.hardware.biometrics.ParentalControlsUtilsInternal#getTestComponentName}
|
||||||
* @return non-null EnforcedAdmin if parental consent is required
|
* @return non-null EnforcedAdmin if parental consent is required
|
||||||
*/
|
*/
|
||||||
public static RestrictedLockUtils.EnforcedAdmin parentConsentRequired(@NonNull Context context,
|
public static RestrictedLockUtils.EnforcedAdmin parentConsentRequired(@NonNull Context context,
|
||||||
@BiometricAuthenticator.Modality int modality) {
|
@BiometricAuthenticator.Modality int modality) {
|
||||||
|
|
||||||
final UserHandle userHandle = new UserHandle(UserHandle.myUserId());
|
final int userId = UserHandle.myUserId();
|
||||||
if (ParentalControlsUtilsInternal.isTestModeEnabled(context)) {
|
final UserHandle userHandle = new UserHandle(userId);
|
||||||
|
final ComponentName testComponentName = ParentalControlsUtilsInternal.getTestComponentName(
|
||||||
|
context, userId);
|
||||||
|
if (testComponentName != null) {
|
||||||
Log.d(TAG, "Requiring consent for test flow");
|
Log.d(TAG, "Requiring consent for test flow");
|
||||||
return new RestrictedLockUtils.EnforcedAdmin(null /* ComponentName */,
|
return new RestrictedLockUtils.EnforcedAdmin(testComponentName,
|
||||||
UserManager.DISALLOW_BIOMETRIC, userHandle);
|
UserManager.DISALLOW_BIOMETRIC, userHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user