diff options
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java | 6 | ||||
-rw-r--r-- | packages/SystemUI/AndroidManifest.xml | 1 |
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"/> |