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

Commit 6f273d49 authored by Rafael Prado's avatar Rafael Prado Committed by Android (Google) Code Review
Browse files

Merge "Remove RESET_PASSWORD_TOKEN policy when the generated escrow token is not valid." into main

parents e048c46e 2727b84f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -19384,11 +19384,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                    PolicyDefinition.RESET_PASSWORD_TOKEN,
                    enforcingAdmin,
                    userId);
            // TODO(b/369152176): Address difference in behavior regarding addEscrowToken when
            //  compared with the else branch.
            long tokenHandle = addEscrowToken(
                    token, currentTokenHandle == null ? 0 : currentTokenHandle, userId);
            if (tokenHandle == 0) {
                mDevicePolicyEngine.removeLocalPolicy(
                        PolicyDefinition.RESET_PASSWORD_TOKEN,
                        enforcingAdmin,
                        userId);
                return false;
            }
            mDevicePolicyEngine.setLocalPolicy(