Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +3 −7 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.keyguard; import android.R.style; import android.app.Activity; import android.app.AlertDialog; import android.app.admin.DevicePolicyManager; Loading @@ -26,7 +25,6 @@ import android.util.AttributeSet; import android.util.Log; import android.util.Slog; import android.util.StatsLog; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; Loading Loading @@ -210,7 +208,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe if (messageId != 0) { final String message = mContext.getString(messageId, KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts(userId), mLockPatternUtils.getCurrentFailedPasswordAttempts(userId), timeoutInSeconds); showDialog(null, message); } Loading Loading @@ -255,8 +253,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe } private void reportFailedUnlockAttempt(int userId, int timeoutMs) { final KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext); final int failedAttempts = monitor.getFailedUnlockAttempts(userId) + 1; // +1 for this time // +1 for this time final int failedAttempts = mLockPatternUtils.getCurrentFailedPasswordAttempts(userId) + 1; if (DEBUG) Log.d(TAG, "reportFailedPatternAttempt: #" + failedAttempts); Loading Loading @@ -290,7 +288,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe showWipeDialog(failedAttempts, userType); } } monitor.reportFailedStrongAuthUnlockAttempt(userId); mLockPatternUtils.reportFailedPasswordAttempt(userId); if (timeoutMs > 0) { mLockPatternUtils.reportPasswordLockout(timeoutMs, userId); Loading Loading @@ -434,7 +431,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe if (success) { StatsLog.write(StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED, StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__RESULT__SUCCESS); monitor.clearFailedUnlockAttempts(); mLockPatternUtils.reportSuccessfulPasswordAttempt(userId); } else { StatsLog.write(StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED, Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +0 −15 Original line number Diff line number Diff line Loading @@ -209,9 +209,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { // Battery status private BatteryStatus mBatteryStatus; // Password attempts private SparseIntArray mFailedAttempts = new SparseIntArray(); private final StrongAuthTracker mStrongAuthTracker; private final ArrayList<WeakReference<KeyguardUpdateMonitorCallback>> Loading Loading @@ -1800,22 +1797,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { return mDeviceProvisioned; } public void clearFailedUnlockAttempts() { mFailedAttempts.delete(sCurrentUser); } public ServiceState getServiceState(int subId) { return mServiceStates.get(subId); } public int getFailedUnlockAttempts(int userId) { return mFailedAttempts.get(userId, 0); } public void reportFailedStrongAuthUnlockAttempt(int userId) { mFailedAttempts.put(userId, getFailedUnlockAttempts(userId) + 1); } public void clearFingerprintRecognized() { mUserFingerprintAuthenticated.clear(); mTrustManager.clearAllFingerprints(); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +0 −1 Original line number Diff line number Diff line Loading @@ -1647,7 +1647,6 @@ public class KeyguardViewMediator extends SystemUI { resetKeyguardDonePendingLocked(); } mUpdateMonitor.clearFailedUnlockAttempts(); mUpdateMonitor.clearFingerprintRecognized(); if (mGoingToSleep) { Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +6 −4 Original line number Diff line number Diff line Loading @@ -4572,11 +4572,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { enforceFullCrossUsersPermission(userHandle); synchronized (getLockObject()) { if (!isCallerWithSystemUid()) { // This API can only be called by an active device admin, // so try to retrieve it to check that the caller is one. // This API can be called by an active device admin or by keyguard code. if (mContext.checkCallingPermission(permission.ACCESS_KEYGUARD_SECURE_STORAGE) != PackageManager.PERMISSION_GRANTED) { getActiveAdminForCallerLocked( null, DeviceAdminInfo.USES_POLICY_WATCH_LOGIN, parent); } } DevicePolicyData policy = getUserDataUnchecked(getCredentialOwner(userHandle, parent)); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +3 −7 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ */ package com.android.keyguard; import android.R.style; import android.app.Activity; import android.app.AlertDialog; import android.app.admin.DevicePolicyManager; Loading @@ -26,7 +25,6 @@ import android.util.AttributeSet; import android.util.Log; import android.util.Slog; import android.util.StatsLog; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; Loading Loading @@ -210,7 +208,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe if (messageId != 0) { final String message = mContext.getString(messageId, KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts(userId), mLockPatternUtils.getCurrentFailedPasswordAttempts(userId), timeoutInSeconds); showDialog(null, message); } Loading Loading @@ -255,8 +253,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe } private void reportFailedUnlockAttempt(int userId, int timeoutMs) { final KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext); final int failedAttempts = monitor.getFailedUnlockAttempts(userId) + 1; // +1 for this time // +1 for this time final int failedAttempts = mLockPatternUtils.getCurrentFailedPasswordAttempts(userId) + 1; if (DEBUG) Log.d(TAG, "reportFailedPatternAttempt: #" + failedAttempts); Loading Loading @@ -290,7 +288,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe showWipeDialog(failedAttempts, userType); } } monitor.reportFailedStrongAuthUnlockAttempt(userId); mLockPatternUtils.reportFailedPasswordAttempt(userId); if (timeoutMs > 0) { mLockPatternUtils.reportPasswordLockout(timeoutMs, userId); Loading Loading @@ -434,7 +431,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe if (success) { StatsLog.write(StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED, StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED__RESULT__SUCCESS); monitor.clearFailedUnlockAttempts(); mLockPatternUtils.reportSuccessfulPasswordAttempt(userId); } else { StatsLog.write(StatsLog.KEYGUARD_BOUNCER_PASSWORD_ENTERED, Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +0 −15 Original line number Diff line number Diff line Loading @@ -209,9 +209,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { // Battery status private BatteryStatus mBatteryStatus; // Password attempts private SparseIntArray mFailedAttempts = new SparseIntArray(); private final StrongAuthTracker mStrongAuthTracker; private final ArrayList<WeakReference<KeyguardUpdateMonitorCallback>> Loading Loading @@ -1800,22 +1797,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { return mDeviceProvisioned; } public void clearFailedUnlockAttempts() { mFailedAttempts.delete(sCurrentUser); } public ServiceState getServiceState(int subId) { return mServiceStates.get(subId); } public int getFailedUnlockAttempts(int userId) { return mFailedAttempts.get(userId, 0); } public void reportFailedStrongAuthUnlockAttempt(int userId) { mFailedAttempts.put(userId, getFailedUnlockAttempts(userId) + 1); } public void clearFingerprintRecognized() { mUserFingerprintAuthenticated.clear(); mTrustManager.clearAllFingerprints(); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +0 −1 Original line number Diff line number Diff line Loading @@ -1647,7 +1647,6 @@ public class KeyguardViewMediator extends SystemUI { resetKeyguardDonePendingLocked(); } mUpdateMonitor.clearFailedUnlockAttempts(); mUpdateMonitor.clearFingerprintRecognized(); if (mGoingToSleep) { Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +6 −4 Original line number Diff line number Diff line Loading @@ -4572,11 +4572,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { enforceFullCrossUsersPermission(userHandle); synchronized (getLockObject()) { if (!isCallerWithSystemUid()) { // This API can only be called by an active device admin, // so try to retrieve it to check that the caller is one. // This API can be called by an active device admin or by keyguard code. if (mContext.checkCallingPermission(permission.ACCESS_KEYGUARD_SECURE_STORAGE) != PackageManager.PERMISSION_GRANTED) { getActiveAdminForCallerLocked( null, DeviceAdminInfo.USES_POLICY_WATCH_LOGIN, parent); } } DevicePolicyData policy = getUserDataUnchecked(getCredentialOwner(userHandle, parent)); Loading