Merge "Fix NPE in DevicePolicyManagerService that crashed SystemUI" into lmp-dev

This commit is contained in:
Adrian Roos
2014-08-07 14:06:46 +00:00
committed by Android (Google) Code Review

View File

@@ -2850,7 +2850,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
if (mHasFeature) {
ActiveAdmin strictestAdmin =
getAdminWithMinimumFailedPasswordsForWipeLocked(userHandle);
int max = strictestAdmin.maximumFailedPasswordsForWipe;
int max = strictestAdmin != null
? strictestAdmin.maximumFailedPasswordsForWipe : 0;
if (max > 0 && policy.mFailedPasswordAttempts >= max) {
// Wipe the user/profile associated with the policy that was violated. This
// is not necessarily calling user: if the policy that fired was from a