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:
Dan Murphy
2009-08-24 17:35:52 -05:00
committed by Paul Eastham
parent 84999d69e0
commit ab97c84da5
4 changed files with 14 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -358,7 +358,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
}
public void onKeyboardChange(boolean isKeyboardOpen) {
if (isKeyboardOpen) {
if (mUpdateMonitor.isKeyguardBypassEnabled() && isKeyboardOpen) {
mCallback.goToUnlockScreen();
}
}