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
This commit is contained in:
Marc Blank 2011-05-23 16:48:14 -07:00
parent faaf1e60f8
commit 4f5d4e29a8

View File

@ -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;
}