Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a059fcec authored by Junchen Quan's avatar Junchen Quan Committed by Android (Google) Code Review
Browse files

Merge "[Device Supervision] Customize ConfirmLockPassword for supervision PIN...

Merge "[Device Supervision] Customize ConfirmLockPassword for supervision PIN verification." into main
parents 51deee21 91c8e387
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_W
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PASSWORD_ATTEMPT_BEFORE_WIPE;
import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PIN_ATTEMPT_BEFORE_WIPE;
import static android.app.admin.DevicePolicyResources.UNDEFINED;
import static android.os.UserManager.USER_TYPE_PROFILE_SUPERVISING;

import static com.android.settings.biometrics.GatekeeperPasswordProvider.containsGatekeeperPasswordHandle;
import static com.android.settings.biometrics.GatekeeperPasswordProvider.getGatekeeperPasswordHandle;
@@ -306,6 +307,11 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
            if (mRemoteValidation) {
                return getString(R.string.lockpassword_remote_validation_header);
            }
            if (android.multiuser.Flags.allowSupervisingProfile() && !mIsAlpha) {
                if (UserManager.get(getActivity()).isUserOfType(USER_TYPE_PROFILE_SUPERVISING)) {
                    return getString(R.string.supervision_full_screen_pin_verification_title);
                }
            }
            if (mIsManagedProfile) {
                if (mIsAlpha) {
                    return mDevicePolicyManager.getResources().getString(
@@ -344,6 +350,11 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
                        ? R.string.lockpassword_remote_validation_password_details
                        : R.string.lockpassword_remote_validation_pin_details);
            }
            if (android.multiuser.Flags.allowSupervisingProfile() && !mIsAlpha) {
                if (UserManager.get(getActivity()).isUserOfType(USER_TYPE_PROFILE_SUPERVISING)) {
                    return "";
                }
            }
            boolean isStrongAuthRequired = isStrongAuthRequired();
            // Map boolean flags to an index by isStrongAuth << 1 + isAlpha.
            int index = ((isStrongAuthRequired ? 1 : 0) << 1) + (mIsAlpha ? 1 : 0);