summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2015-12-19 19:02:57 -0500
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-16 03:51:08 +0100
commite4ff31827b11e107f6c9b03e5efb09165fc340f3 (patch)
treee55805079d406b587c5410042ba9364d5d38b99f
parent73e4ff6ef31cce010d31bf4b0bd8990a7bfd85bc (diff)
downloadframeworks_base-e4ff31827b11e107f6c9b03e5efb09165fc340f3.zip
frameworks_base-e4ff31827b11e107f6c9b03e5efb09165fc340f3.tar.gz
frameworks_base-e4ff31827b11e107f6c9b03e5efb09165fc340f3.tar.bz2
defend against lockscreen brute forcing
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java6
-rw-r--r--packages/SystemUI/AndroidManifest.xml1
2 files changed, 7 insertions, 0 deletions
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 @@
<uses-permission android:name="android.permission.TRUST_LISTENER" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.RESET_FINGERPRINT_LOCKOUT" />
+ <uses-permission android:name="android.permission.REBOOT" />
<!-- Needed for WallpaperManager.clear in ImageWallpaper.updateWallpaperLocked -->
<uses-permission android:name="android.permission.SET_WALLPAPER"/>