Merge "Set up correct ComponentName for test mode of Parental Controls" into tm-dev am: d191a16c54
am: e2dd5d9fdd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17504393 Change-Id: I1ad92f2bc0c0cd807061bc6598e773c6b2f5a767 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
|
||||
* {@link android.hardware.biometrics.ParentalControlsUtilsInternal#isTestModeEnabled(Context)}
|
||||
* {@link android.hardware.biometrics.ParentalControlsUtilsInternal#getTestComponentName}
|
||||
* @return non-null EnforcedAdmin if parental consent is required
|
||||
*/
|
||||
public static RestrictedLockUtils.EnforcedAdmin parentConsentRequired(@NonNull Context context,
|
||||
@BiometricAuthenticator.Modality int modality) {
|
||||
|
||||
final UserHandle userHandle = new UserHandle(UserHandle.myUserId());
|
||||
if (ParentalControlsUtilsInternal.isTestModeEnabled(context)) {
|
||||
final int userId = UserHandle.myUserId();
|
||||
final UserHandle userHandle = new UserHandle(userId);
|
||||
final ComponentName testComponentName = ParentalControlsUtilsInternal.getTestComponentName(
|
||||
context, userId);
|
||||
if (testComponentName != null) {
|
||||
Log.d(TAG, "Requiring consent for test flow");
|
||||
return new RestrictedLockUtils.EnforcedAdmin(null /* ComponentName */,
|
||||
return new RestrictedLockUtils.EnforcedAdmin(testComponentName,
|
||||
UserManager.DISALLOW_BIOMETRIC, userHandle);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user