From af4426bb65dde5aab4913a19a99143b9737242cb Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Mon, 29 Oct 2018 13:09:12 -0700 Subject: [PATCH] Use ImeAwareEditText in FingerprintSettings Like we did the same thing in the Settings app [1][2][3], FingerprintSetting is another instance that should use ImeAwareEditText to make sure InputMethodManager#showSoftInput() is called after the EditText gains IME focus. This approach should be more robust and easier to maintain than trying to control the software keyboard visibility with SOFT_INPUT_STATE_ALWAYS_VISIBLE, which is more complicated that people think. This CL also removes RenameDialog#mTextHadFocus since RenameDialog#mDialogTextField is always focused when the dialog is shown [4]. This CL also removes the following fields since they can just be a local final variables that will be captured into callback. * RenameDialog#mFingerName * RenameDialog#mTextSelectionStart * RenameDialog#mTextSelectionEnd [1]: I182b05d3ff59fb3b4732d60d0d5a464f0e0e0235 f6af093e2dfd156768a3937e94d405c04c541fea [2]: I892d639f3cc5d43db553b682d5278b8ce2fe72da 480326710681b1ef1c1a55cf38b3de10ed75f27e [3]: Ib75ba0f361b8b46c3b717cc1ffb864726958ed82 b0bcbed3722bcd16ba16f49f36c84ed8f8825ae3 [4]: I5bb1b7227c1323595bf7f483e11e87e2c3550093 7a1d52eb061a7b936f15aa99b997a87f5bb0b16f Fix: 118473687 Test: Manually verified as follows. 1. Build and flash aosp_taimen-userdebug to Taimen 2. Set up a fingerprint unlock. 3. Rotate the device to landscape mode. 4. Open Settings -> Security & location -> Fingerprint 5. Re-enter password if necessary 6. Tap "Finger 1" 7. Make sure that AOSP Keyboard shows up Change-Id: I2a137aa8f6a1ee2b67923bcf40e82320a56c7b59 --- res/layout/fingerprint_rename_dialog.xml | 2 +- .../fingerprint/FingerprintSettings.java | 39 +++++++++---------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/res/layout/fingerprint_rename_dialog.xml b/res/layout/fingerprint_rename_dialog.xml index 99cfa718d0e..2da84ca9876 100644 --- a/res/layout/fingerprint_rename_dialog.xml +++ b/res/layout/fingerprint_rename_dialog.xml @@ -35,7 +35,7 @@ android:clipChildren="false" android:clipToPadding="false" /> -