Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4e0492c authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Android (Google) Code Review
Browse files

Merge "No auto soft keyboard when fp is in use" into mnc-dev

parents 44fb627c 4f8102d4
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
        private CountDownTimer mCountdownTimer;
        private boolean mIsAlpha;
        private InputMethodManager mImm;
        private boolean mUsingFingerprint = false;

        // required constructor for fragments
        public ConfirmLockPasswordFragment() {
@@ -203,11 +204,22 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
            getActivity().finish();
        }

        @Override
        public void onFingerprintIconVisibilityChanged(boolean visible) {
            mUsingFingerprint = visible;
        }

        private void resetState() {
            mPasswordEntry.setEnabled(true);
            mPasswordEntryInputDisabler.setInputEnabled(true);
            if (shouldAutoShowSoftKeyboard()) {
                mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
            }
        }

        private boolean shouldAutoShowSoftKeyboard() {
            return mPasswordEntry.isEnabled() && !mUsingFingerprint;
        }

        public void onWindowFocusChanged(boolean hasFocus) {
            if (!hasFocus) {
@@ -217,7 +229,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
            mPasswordEntry.post(new Runnable() {
                @Override
                public void run() {
                    if (mPasswordEntry.isEnabled()) {
                    if (shouldAutoShowSoftKeyboard()) {
                        resetState();
                        return;
                    }