am 69ed3308: Merge "Allow system to disable lockscreen" into mnc-dev
* commit '69ed33087d77e32a1f1475adf00b9d87580960aa': Allow system to disable lockscreen
This commit is contained in:
@@ -841,11 +841,6 @@ public class KeyguardViewMediator extends SystemUI {
|
|||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (DEBUG) Log.d(TAG, "setKeyguardEnabled(" + enabled + ")");
|
if (DEBUG) Log.d(TAG, "setKeyguardEnabled(" + enabled + ")");
|
||||||
|
|
||||||
if (isSecure()) {
|
|
||||||
Log.d(TAG, "current mode is SecurityMode, ignore hide keyguard");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mExternallyEnabled = enabled;
|
mExternallyEnabled = enabled;
|
||||||
|
|
||||||
if (!enabled && mShowing) {
|
if (!enabled && mShowing) {
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
|||||||
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
|
import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
|
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
|
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||||
@@ -5367,6 +5366,12 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
!= PackageManager.PERMISSION_GRANTED) {
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
throw new SecurityException("Requires DISABLE_KEYGUARD permission");
|
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) {
|
if (token == null) {
|
||||||
throw new IllegalArgumentException("token == null");
|
throw new IllegalArgumentException("token == null");
|
||||||
|
|||||||
Reference in New Issue
Block a user