From 4f5d4e29a8180b5c1e8cd80f5e3e9c4ed098049c Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 23 May 2011 16:48:14 -0700 Subject: [PATCH] Always set policies in DPM before checking whether they are active * Since DPM can erroneously report a password failure (specifically, isActivePasswordSufficient() can return false when, in fact, the active password is just fine) * This is the proximate cause of the referenced bug; we just weren't prepared to have the DPM mislead us... Bug: 4464610 Change-Id: Ifcb85c0729e9a1884fbcf7b4180eb332bbfef1b5 --- src/com/android/email/SecurityPolicy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/email/SecurityPolicy.java b/src/com/android/email/SecurityPolicy.java index 2362faa9d..9f87f29b0 100644 --- a/src/com/android/email/SecurityPolicy.java +++ b/src/com/android/email/SecurityPolicy.java @@ -291,6 +291,10 @@ public class SecurityPolicy { * @return true if the requested policies are active, false if not. */ public boolean isActive(PolicySet policies) { + // Since the DPM reports password failures erroneously, we add this workaround that + // ensures that our most recent aggregate policy is set before checking whether those + // policies are in force + setActivePolicies(); int reasons = getInactiveReasons(policies); return reasons == 0; }