am adb9554d: Merge "Enable back button in keyguard security account mode." into jb-mr2-dev
* commit 'adb9554d993a8510bfc3866538faaa042d629731': Enable back button in keyguard security account mode.
This commit is contained in:
@@ -310,9 +310,7 @@ public class KeyguardHostView extends KeyguardViewBase {
|
||||
mKeyguardSelectorView = (KeyguardSelectorView) findViewById(R.id.keyguard_selector_view);
|
||||
mViewStateManager.setSecurityViewContainer(mSecurityViewContainer);
|
||||
|
||||
if (!(mContext instanceof Activity)) {
|
||||
setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
|
||||
}
|
||||
setBackButtonEnabled(false);
|
||||
|
||||
addDefaultWidgets();
|
||||
|
||||
@@ -329,6 +327,13 @@ public class KeyguardHostView extends KeyguardViewBase {
|
||||
updateSecurityViews();
|
||||
}
|
||||
|
||||
private void setBackButtonEnabled(boolean enabled) {
|
||||
if (mContext instanceof Activity) return; // always enabled in activity mode
|
||||
setSystemUiVisibility(enabled ?
|
||||
getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_BACK :
|
||||
getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
|
||||
}
|
||||
|
||||
private boolean shouldEnableAddWidget() {
|
||||
return numWidgets() < MAX_WIDGETS && mUserSetupCompleted;
|
||||
}
|
||||
@@ -907,6 +912,10 @@ public class KeyguardHostView extends KeyguardViewBase {
|
||||
// Discard current runnable if we're switching back to the selector view
|
||||
setOnDismissAction(null);
|
||||
}
|
||||
if (securityMode == SecurityMode.Account && !mLockPatternUtils.isPermanentlyLocked()) {
|
||||
// we're showing account as a backup, provide a way to get back to primary
|
||||
setBackButtonEnabled(true);
|
||||
}
|
||||
mCurrentSecuritySelection = securityMode;
|
||||
}
|
||||
|
||||
@@ -1579,6 +1588,12 @@ public class KeyguardHostView extends KeyguardViewBase {
|
||||
}
|
||||
|
||||
public boolean handleBackKey() {
|
||||
if (mCurrentSecuritySelection == SecurityMode.Account) {
|
||||
// go back to primary screen and re-disable back
|
||||
setBackButtonEnabled(false);
|
||||
showPrimarySecurityScreen(false /*turningOff*/);
|
||||
return true;
|
||||
}
|
||||
if (mCurrentSecuritySelection != SecurityMode.None) {
|
||||
mCallback.dismiss(false);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user