policy/impl: Add option to disable screen-unlock-on-slider-open
Signed-off-by: Dan Murphy <D.Murphy@motorola.com>
This commit is contained in:
@@ -66,6 +66,8 @@ public class KeyguardUpdateMonitor {
|
||||
private boolean mInPortrait;
|
||||
private boolean mKeyboardOpen;
|
||||
|
||||
private boolean mKeyguardBypassEnabled;
|
||||
|
||||
private boolean mDevicePluggedIn;
|
||||
|
||||
private boolean mDeviceProvisioned;
|
||||
@@ -162,6 +164,9 @@ public class KeyguardUpdateMonitor {
|
||||
}
|
||||
};
|
||||
|
||||
mKeyguardBypassEnabled = context.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_bypass_keyguard_if_slider_open);
|
||||
|
||||
mDeviceProvisioned = Settings.Secure.getInt(
|
||||
mContext.getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 0) != 0;
|
||||
|
||||
@@ -505,6 +510,10 @@ public class KeyguardUpdateMonitor {
|
||||
return mKeyboardOpen;
|
||||
}
|
||||
|
||||
public boolean isKeyguardBypassEnabled() {
|
||||
return mKeyguardBypassEnabled;
|
||||
}
|
||||
|
||||
public boolean isDevicePluggedIn() {
|
||||
return mDevicePluggedIn;
|
||||
}
|
||||
|
||||
@@ -571,8 +571,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
|
||||
public void onKeyboardChange(boolean isKeyboardOpen) {
|
||||
mKeyboardOpen = isKeyboardOpen;
|
||||
|
||||
if (mKeyboardOpen && !mKeyguardViewProperties.isSecure()
|
||||
&& mKeyguardViewManager.isShowing()) {
|
||||
if (mUpdateMonitor.isKeyguardBypassEnabled() && mKeyboardOpen
|
||||
&& !mKeyguardViewProperties.isSecure() && mKeyguardViewManager.isShowing()) {
|
||||
if (DEBUG) Log.d(TAG, "bypassing keyguard on sliding open of keyboard with non-secure keyguard");
|
||||
keyguardDone(true);
|
||||
}
|
||||
|
||||
@@ -521,7 +521,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
|
||||
final IccCard.State simState = mUpdateMonitor.getSimState();
|
||||
if (stuckOnLockScreenBecauseSimMissing() || (simState == IccCard.State.PUK_REQUIRED)) {
|
||||
return Mode.LockScreen;
|
||||
} else if (mUpdateMonitor.isKeyboardOpen() && isSecure()) {
|
||||
} else if (mUpdateMonitor.isKeyguardBypassEnabled() && mUpdateMonitor.isKeyboardOpen()
|
||||
&& isSecure()) {
|
||||
return Mode.UnlockScreen;
|
||||
} else {
|
||||
return Mode.LockScreen;
|
||||
|
||||
@@ -358,7 +358,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
|
||||
}
|
||||
|
||||
public void onKeyboardChange(boolean isKeyboardOpen) {
|
||||
if (isKeyboardOpen) {
|
||||
if (mUpdateMonitor.isKeyguardBypassEnabled() && isKeyboardOpen) {
|
||||
mCallback.goToUnlockScreen();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user