Bug 1266683 - Part 1 - Support IME private mode in address bar. r?jchen draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 30 Jul 2017 00:21:46 +0200
changeset 621291 af1b2607f2b30c76d76ed2b93eaadd1507a68935
parent 621290 521e1c46dfbbf0089574261be86b0dec6da32cb9
child 621292 778dbbc2208487281df788fb812b0403b032581c
child 621305 90ed7b05cc7d11b7bb479c8e2fcae2ea0d619cc9
child 641133 1f77a499db05e965a8c558615a95fb4d88578e40
push id72321
push usermozilla@buttercookie.de
push dateFri, 04 Aug 2017 16:00:40 +0000
reviewersjchen
bugs1266683
milestone56.0a1
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
mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditText.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java
--- 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;
 }