Skip to content

Commit a042ac9

Browse files
committed
Don't pop the IME for passwors at ScreenOn on tablets.
Change-Id: I4c157559b2a70021d55211607c1d62ba73adc590
1 parent cabcc59 commit a042ac9

14 files changed

+29
-17
lines changed

core/res/res/values-sw600dp/bools.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<bool name="show_ongoing_ime_switcher">true</bool>
2020
<bool name="kg_share_status_area">false</bool>
2121
<bool name="kg_sim_puk_account_full_screen">false</bool>
22+
<bool name="kg_show_ime_at_screen_on">false</bool>
2223
<!-- No camera for you, tablet user -->
2324
<bool name="kg_enable_camera_default_widget">false</bool>
2425
<bool name="kg_center_small_widgets_vertically">true</bool>

core/res/res/values/bools.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<bool name="kg_enable_camera_default_widget">true</bool>
1919
<bool name="kg_center_small_widgets_vertically">false</bool>
2020
<bool name="kg_top_align_page_shrink_on_bouncer_visible">true</bool>
21+
<bool name="kg_show_ime_at_screen_on">true</bool>
2122
<bool name="action_bar_embed_tabs">true</bool>
2223
<bool name="action_bar_embed_tabs_pre_jb">false</bool>
2324
<bool name="split_action_bar_is_narrow">true</bool>

core/res/res/values/symbols.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,7 @@
12181218
<java-symbol type="bool" name="kg_top_align_page_shrink_on_bouncer_visible" />
12191219
<java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
12201220
<java-symbol type="bool" name="kg_center_small_widgets_vertically" />
1221+
<java-symbol type="bool" name="kg_show_ime_at_screen_on" />
12211222
<java-symbol type="color" name="kg_multi_user_text_active" />
12221223
<java-symbol type="color" name="kg_multi_user_text_inactive" />
12231224
<java-symbol type="color" name="kg_widget_pager_gradient" />

policy/src/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public void onPause() {
215215
}
216216

217217
@Override
218-
public void onResume() {
218+
public void onResume(int reason) {
219219
reset();
220220
}
221221

policy/src/com/android/internal/policy/impl/keyguard/KeyguardAccountView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public void onPause() {
314314
}
315315

316316
@Override
317-
public void onResume() {
317+
public void onResume(int reason) {
318318
reset();
319319
}
320320

policy/src/com/android/internal/policy/impl/keyguard/KeyguardFaceUnlockView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void onPause() {
103103
}
104104

105105
@Override
106-
public void onResume() {
106+
public void onResume(int reason) {
107107
if (DEBUG) Log.d(TAG, "onResume()");
108108
mIsShowing = KeyguardUpdateMonitor.getInstance(mContext).isKeyguardVisible();
109109
maybeStartBiometricUnlock();

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ private void showSecurityScreen(SecurityMode securityMode) {
732732
oldView.onPause();
733733
oldView.setKeyguardCallback(mNullCallback); // ignore requests from old view
734734
}
735-
newView.onResume();
735+
newView.onResume(KeyguardSecurityView.VIEW_REVEALED);
736736
newView.setKeyguardCallback(mCallback);
737737

738738
final boolean needsInput = newView.needsInput();
@@ -766,7 +766,7 @@ private void showSecurityScreen(SecurityMode securityMode) {
766766
public void onScreenTurnedOn() {
767767
if (DEBUG) Log.d(TAG, "screen on, instance " + Integer.toHexString(hashCode()));
768768
showPrimarySecurityScreen(false);
769-
getSecurityView(mCurrentSecuritySelection).onResume();
769+
getSecurityView(mCurrentSecuritySelection).onResume(KeyguardSecurityView.SCREEN_ON);
770770

771771
// This is a an attempt to fix bug 7137389 where the device comes back on but the entire
772772
// layout is blank but forcing a layout causes it to reappear (e.g. with with

policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@
4444
public class KeyguardPasswordView extends KeyguardAbsKeyInputView
4545
implements KeyguardSecurityView, OnEditorActionListener, TextWatcher {
4646

47+
private final boolean mShowImeAtScreenOn;
48+
4749
InputMethodManager mImm;
4850

4951
public KeyguardPasswordView(Context context) {
50-
super(context);
52+
this(context, null);
5153
}
5254

5355
public KeyguardPasswordView(Context context, AttributeSet attrs) {
5456
super(context, attrs);
57+
mShowImeAtScreenOn = context.getResources().
58+
getBoolean(R.bool.kg_show_ime_at_screen_on);
5559
}
5660

5761
protected void resetState() {
@@ -70,11 +74,12 @@ public boolean needsInput() {
7074
}
7175

7276
@Override
73-
public void onResume() {
74-
super.onResume();
75-
// XXX this is still not right because onResume is being called every time the page changes
77+
public void onResume(int reason) {
78+
super.onResume(reason);
7679
mPasswordEntry.requestFocus();
77-
mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
80+
if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
81+
mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
82+
}
7883
}
7984

8085
@Override

policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ public void onPause() {
384384
}
385385

386386
@Override
387-
public void onResume() {
387+
public void onResume(int reason) {
388388
reset();
389389
}
390390

policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityView.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import com.android.internal.widget.LockPatternUtils;
1919

2020
public interface KeyguardSecurityView {
21+
static public final int SCREEN_ON = 1;
22+
static public final int VIEW_REVEALED = 2;
23+
2124
/**
2225
* Interface back to keyguard to tell it when security
2326
* @param callback
@@ -45,8 +48,9 @@ public interface KeyguardSecurityView {
4548
/**
4649
* Emulate activity life cycle within this view. When called, the view should prepare itself
4750
* to be shown.
51+
* @param reason the root cause of the event.
4852
*/
49-
void onResume();
53+
void onResume(int reason);
5054

5155
/**
5256
* Inquire whether this view requires IME (keyboard) interaction.

0 commit comments

Comments
 (0)