From e4ff31827b11e107f6c9b03e5efb09165fc340f3 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 19 Dec 2015 19:02:57 -0500 Subject: defend against lockscreen brute forcing --- .../src/com/android/keyguard/KeyguardSecurityContainer.java | 6 ++++++ packages/SystemUI/AndroidManifest.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java index 827b378..f8d7fc9 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -20,6 +20,7 @@ import android.app.AlertDialog; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.os.RemoteException; +import android.os.PowerManager; import android.os.UserHandle; import android.util.AttributeSet; import android.util.Log; @@ -294,6 +295,11 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe if (timeoutMs > 0) { showTimeoutDialog(timeoutMs); } + + if (mLockPatternUtils.isSeparateEncryptionPasswordEnabled() && failedAttempts >= 5) { + final PowerManager powerManager = mContext.getSystemService(PowerManager.class); + powerManager.reboot(null); + } } /** diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index d45b52b..4b49196 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -109,6 +109,7 @@ + -- cgit v1.1