Bug 1266683 - Part 1 - Support IME private mode in address bar. r?jchen
We don't build with the required version of the support library yet, so in the meantime we just copy the needed options flag definition and define it ourselves.
MozReview-Commit-ID: 3wAbquE5rOT
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditText.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditText.java
@@ -423,16 +423,17 @@ public class ToolbarEditText extends Cus
public InputConnection onCreateInputConnection(final EditorInfo outAttrs) {
final InputConnection ic = super.onCreateInputConnection(outAttrs);
if (ic == null) {
return null;
}
if (isPrivateMode()) {
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
+ outAttrs.imeOptions |= InputMethods.IME_FLAG_NO_PERSONALIZED_LEARNING;
}
return new InputConnectionWrapper(ic, false) {
@Override
public boolean deleteSurroundingText(final int beforeLength, final int afterLength) {
if (removeAutocomplete(getText())) {
// If we have autocomplete text, the cursor is at the boundary between
// regular and autocomplete text. So regardless of which direction we
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java
@@ -69,9 +69,12 @@ final public class InputMethods {
public static boolean shouldCommitCharAsKey(String inputMethod) {
return METHOD_HTC_TOUCH_INPUT.equals(inputMethod);
}
public static boolean needsRemoveAutocompleteHack(Context context) {
String inputMethod = getCurrentInputMethod(context);
return METHOD_SONY.equals(inputMethod);
}
+
+ // TODO: Replace usages by definition in EditorInfoCompat once available (bug 1385726).
+ public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 0x1000000;
}