am e0d9fe59: am 635270c5: am a01965e2: am 69a07d40: am 69ed3308: Merge "Allow system to disable lockscreen" into mnc-dev

* commit 'e0d9fe59856241fb34212b4ad160dbc8f76e4343':
  Allow system to disable lockscreen
This commit is contained in:
Jason Monk
2015-08-07 23:07:25 +00:00
committed by Android Git Automerger
2 changed files with 6 additions and 5 deletions

View File

@@ -841,11 +841,6 @@ public class KeyguardViewMediator extends SystemUI {
synchronized (this) {
if (DEBUG) Log.d(TAG, "setKeyguardEnabled(" + enabled + ")");
if (isSecure()) {
Log.d(TAG, "current mode is SecurityMode, ignore hide keyguard");
return;
}
mExternallyEnabled = enabled;
if (!enabled && mShowing) {

View File

@@ -5363,6 +5363,12 @@ public class WindowManagerService extends IWindowManager.Stub
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires DISABLE_KEYGUARD permission");
}
// If this isn't coming from the system then don't allow disabling the lockscreen
// to bypass security.
if (Binder.getCallingUid() != Process.SYSTEM_UID && isKeyguardSecure()) {
Log.d(TAG, "current mode is SecurityMode, ignore hide keyguard");
return;
}
if (token == null) {
throw new IllegalArgumentException("token == null");