am cf9ee4c5: Merge "Don\'t pop the IME for passwors at ScreenOn on tablets." into jb-mr1-lockscreen-dev

* commit 'cf9ee4c55db750f86fdcb765c4f21c44bb4bc893':
  Don't pop the IME for passwors at ScreenOn on tablets.
This commit is contained in:
Chris Wren
2012-11-07 11:14:56 -08:00
committed by Android Git Automerger
14 changed files with 29 additions and 17 deletions

View File

@@ -19,6 +19,7 @@
<bool name="show_ongoing_ime_switcher">true</bool>
<bool name="kg_share_status_area">false</bool>
<bool name="kg_sim_puk_account_full_screen">false</bool>
<bool name="kg_show_ime_at_screen_on">false</bool>
<!-- No camera for you, tablet user -->
<bool name="kg_enable_camera_default_widget">false</bool>
<bool name="kg_center_small_widgets_vertically">true</bool>

View File

@@ -18,6 +18,7 @@
<bool name="kg_enable_camera_default_widget">true</bool>
<bool name="kg_center_small_widgets_vertically">false</bool>
<bool name="kg_top_align_page_shrink_on_bouncer_visible">true</bool>
<bool name="kg_show_ime_at_screen_on">true</bool>
<bool name="action_bar_embed_tabs">true</bool>
<bool name="action_bar_embed_tabs_pre_jb">false</bool>
<bool name="split_action_bar_is_narrow">true</bool>

View File

@@ -1218,6 +1218,7 @@
<java-symbol type="bool" name="kg_top_align_page_shrink_on_bouncer_visible" />
<java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
<java-symbol type="bool" name="kg_center_small_widgets_vertically" />
<java-symbol type="bool" name="kg_show_ime_at_screen_on" />
<java-symbol type="color" name="kg_multi_user_text_active" />
<java-symbol type="color" name="kg_multi_user_text_inactive" />
<java-symbol type="color" name="kg_widget_pager_gradient" />

View File

@@ -215,7 +215,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
}
@Override
public void onResume() {
public void onResume(int reason) {
reset();
}

View File

@@ -314,7 +314,7 @@ public class KeyguardAccountView extends LinearLayout implements KeyguardSecurit
}
@Override
public void onResume() {
public void onResume(int reason) {
reset();
}

View File

@@ -103,7 +103,7 @@ public class KeyguardFaceUnlockView extends LinearLayout implements KeyguardSecu
}
@Override
public void onResume() {
public void onResume(int reason) {
if (DEBUG) Log.d(TAG, "onResume()");
mIsShowing = KeyguardUpdateMonitor.getInstance(mContext).isKeyguardVisible();
maybeStartBiometricUnlock();

View File

@@ -739,7 +739,7 @@ public class KeyguardHostView extends KeyguardViewBase {
oldView.onPause();
oldView.setKeyguardCallback(mNullCallback); // ignore requests from old view
}
newView.onResume();
newView.onResume(KeyguardSecurityView.VIEW_REVEALED);
newView.setKeyguardCallback(mCallback);
final boolean needsInput = newView.needsInput();
@@ -773,7 +773,7 @@ public class KeyguardHostView extends KeyguardViewBase {
public void onScreenTurnedOn() {
if (DEBUG) Log.d(TAG, "screen on, instance " + Integer.toHexString(hashCode()));
showPrimarySecurityScreen(false);
getSecurityView(mCurrentSecuritySelection).onResume();
getSecurityView(mCurrentSecuritySelection).onResume(KeyguardSecurityView.SCREEN_ON);
// This is a an attempt to fix bug 7137389 where the device comes back on but the entire
// layout is blank but forcing a layout causes it to reappear (e.g. with with

View File

@@ -44,14 +44,18 @@ import java.util.List;
public class KeyguardPasswordView extends KeyguardAbsKeyInputView
implements KeyguardSecurityView, OnEditorActionListener, TextWatcher {
private final boolean mShowImeAtScreenOn;
InputMethodManager mImm;
public KeyguardPasswordView(Context context) {
super(context);
this(context, null);
}
public KeyguardPasswordView(Context context, AttributeSet attrs) {
super(context, attrs);
mShowImeAtScreenOn = context.getResources().
getBoolean(R.bool.kg_show_ime_at_screen_on);
}
protected void resetState() {
@@ -70,11 +74,12 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
}
@Override
public void onResume() {
super.onResume();
// XXX this is still not right because onResume is being called every time the page changes
public void onResume(int reason) {
super.onResume(reason);
mPasswordEntry.requestFocus();
mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
}
}
@Override

View File

@@ -384,7 +384,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}
@Override
public void onResume() {
public void onResume(int reason) {
reset();
}

View File

@@ -18,6 +18,9 @@ package com.android.internal.policy.impl.keyguard;
import com.android.internal.widget.LockPatternUtils;
public interface KeyguardSecurityView {
static public final int SCREEN_ON = 1;
static public final int VIEW_REVEALED = 2;
/**
* Interface back to keyguard to tell it when security
* @param callback
@@ -45,8 +48,9 @@ public interface KeyguardSecurityView {
/**
* Emulate activity life cycle within this view. When called, the view should prepare itself
* to be shown.
* @param reason the root cause of the event.
*/
void onResume();
void onResume(int reason);
/**
* Inquire whether this view requires IME (keyboard) interaction.

View File

@@ -107,10 +107,10 @@ public class KeyguardSecurityViewFlipper extends ViewFlipper implements Keyguard
}
@Override
public void onResume() {
public void onResume(int reason) {
KeyguardSecurityView ksv = getSecurityView();
if (ksv != null) {
ksv.onResume();
ksv.onResume(reason);
}
}

View File

@@ -253,7 +253,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri
}
@Override
public void onResume() {
public void onResume(int reason) {
KeyguardUpdateMonitor.getInstance(getContext()).registerCallback(mInfoCallback);
}

View File

@@ -169,7 +169,7 @@ class KeyguardStatusViewManager implements SecurityMessageDisplay {
}
/** {@inheritDoc} */
public void onResume() {
public void onResume(int reason) {
if (DEBUG) Log.v(TAG, "onResume()");
// Force-update the time when we show this view.

View File

@@ -218,7 +218,7 @@ public class KeyguardViewStateManager implements
updateEdgeSwiping();
if (mChallengeLayout.isChallengeShowing()) {
mKeyguardSecurityContainer.onResume();
mKeyguardSecurityContainer.onResume(KeyguardSecurityView.VIEW_REVEALED);
} else {
mKeyguardSecurityContainer.onPause();
}