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

Commit 36ebae2e authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Handle new flag NO_SUGGESTIONS and no auto-correct for single-line fields...

Handle new flag NO_SUGGESTIONS and no auto-correct for single-line fields unless requested. Fix: 2030364

Don't show suggestions if NO_SUGGESTIONS flag is specified. And don't do auto-correction unless
explicitly requested or it's a multi-line text.
parent 3ec2ed75
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -308,6 +308,17 @@ public class LatinIME extends InputMethodService
                        disableAutoCorrect = true;
                    }
                }

                // If NO_SUGGESTIONS is set, don't do prediction.
                if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS) != 0) {
                    mPredictionOn = false;
                    disableAutoCorrect = true;
                }
                // If it's not multiline and the autoCorrect flag is not set, then don't correct
                if ((attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) == 0 &&
                        (attribute.inputType & EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE) == 0) {
                    disableAutoCorrect = true;
                }
                if ((attribute.inputType&EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) != 0) {
                    mPredictionOn = false;
                    mCompletionOn = true && isFullscreenMode();