summaryrefslogtreecommitdiff
path: root/core/java/android/preference/DialogPreference.java
diff options
context:
space:
mode:
authorMing-Shin Lu <lumark@google.com>2020-08-14 01:23:33 +0800
committerMing-Shin Lu <lumark@google.com>2020-08-22 00:33:46 +0800
commitd5ae401390b2dd9b44127a161d0f66075db91dcb (patch)
tree179a18962a882cc44ddb58433b914fa621697bae /core/java/android/preference/DialogPreference.java
parenta806511dca36a61853152724f514d3ef840e69ed (diff)
Fix showing keyboard without editor focused in some cases (2/2)
As CL[1] mentioned issue symptom, we also need to remove STATE_ALWAYS_VISIBLE in EditTextPreference and using new WindowInsets API to show soft-keyboard, to prevent the keyboard may be shown without focusing editor case. [1]: I37ae6e30d1de581ba15131c2a90396b3a522a4d6 Fix: 165910518 Test: atest CtsInputMethodTestCases Test: manual as issue steps 1. Enter Dialer-> Menu -> Settings-> calling accounts -> Fixed Dialing Numbers 2. Tap change pin2 code, input old pin2 -> pressing ok button 3. Check if password keyboard shown Change-Id: I763838fb7b887e09b46b1fb2360a515b77de8dd4
Diffstat (limited to 'core/java/android/preference/DialogPreference.java')
-rw-r--r--core/java/android/preference/DialogPreference.java23
1 files changed, 0 insertions, 23 deletions
diff --git a/core/java/android/preference/DialogPreference.java b/core/java/android/preference/DialogPreference.java
index dfdb57c4e3f8..fb7b2320915c 100644
--- a/core/java/android/preference/DialogPreference.java
+++ b/core/java/android/preference/DialogPreference.java
@@ -36,8 +36,6 @@ import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.Window;
-import android.view.WindowManager;
import android.widget.TextView;
/**
@@ -337,9 +335,6 @@ public abstract class DialogPreference extends Preference implements
if (state != null) {
dialog.onRestoreInstanceState(state);
}
- if (needInputMethod()) {
- requestInputMethod(dialog);
- }
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
@@ -380,24 +375,6 @@ public abstract class DialogPreference extends Preference implements
}
/**
- * Returns whether the preference needs to display a soft input method when the dialog
- * is displayed. Default is false. Subclasses should override this method if they need
- * the soft input method brought up automatically.
- * @hide
- */
- protected boolean needInputMethod() {
- return false;
- }
-
- /**
- * Sets the required flags on the dialog window to enable input method window to show up.
- */
- private void requestInputMethod(Dialog dialog) {
- Window window = dialog.getWindow();
- window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
- }
-
- /**
* Creates the content view for the dialog (if a custom content view is
* required). By default, it inflates the dialog layout resource if it is
* set.