Bug 1546411 - [geckoview] Hide all @IntDef and @StringDef. r=esawin
☠☠ backed out by 358171d00f9a ☠ ☠
authorAgi Sferro <agi@sferro.dev>
Tue, 23 Apr 2019 22:58:50 +0000
changeset 470576 a66f1ffd23ea29db37a0f1b11141c1fe6699dddb
parent 470575 a322ec5c25e6e6ebe0e0bc11c281162408c95982
child 470577 2d7e3754d9660de1fd99ac145fd89318c4d84c6d
push id35908
push useraciure@mozilla.com
push dateWed, 24 Apr 2019 04:28:40 +0000
treeherdermozilla-central@c9f0730a57a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersesawin
bugs1546411
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546411 - [geckoview] Hide all @IntDef and @StringDef. r=esawin Differential Revision: https://phabricator.services.mozilla.com/D28503
build.gradle
mobile/android/geckoview/api.txt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExecutorTest.kt
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoWebExecutor.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequest.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequestError.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
--- a/build.gradle
+++ b/build.gradle
@@ -76,17 +76,17 @@ buildscript {
     ext.jacoco_version = '0.8.1'
 
     if (gradle.mozconfig.substs.MOZ_ANDROID_GOOGLE_PLAY_SERVICES) {
         ext.google_play_services_version = '15.0.1'
         ext.google_play_services_cast_version = '16.0.0'
     }
 
     dependencies {
-        classpath 'org.mozilla.apilint:apilint:0.2.0'
+        classpath 'org.mozilla.apilint:apilint:0.2.1'
         classpath 'com.android.tools.build:gradle:3.1.4'
         classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
         classpath 'org.apache.commons:commons-exec:1.3'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
 
 // A stream that processes bytes line by line, prepending a tag before sending
--- a/mobile/android/geckoview/api.txt
+++ b/mobile/android/geckoview/api.txt
@@ -45,17 +45,16 @@ import java.lang.Exception;
 import java.lang.Float;
 import java.lang.Integer;
 import java.lang.Object;
 import java.lang.Runnable;
 import java.lang.RuntimeException;
 import java.lang.String;
 import java.lang.Throwable;
 import java.lang.Void;
-import java.lang.annotation.Annotation;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
 import java.util.AbstractSequentialList;
 import java.util.List;
 import java.util.Map;
 import org.json.JSONObject;
 import org.mozilla.geckoview.AllowOrDeny;
 import org.mozilla.geckoview.CompositorController;
@@ -510,19 +509,16 @@ package org.mozilla.geckoview {
     method @AnyThread @NonNull default public String getTitle();
     method @AnyThread @NonNull default public String getUri();
   }
 
   public static interface GeckoSession.HistoryDelegate.HistoryList implements List {
     method @AnyThread default public int getCurrentIndex();
   }
 
-  public static interface GeckoSession.HistoryDelegate.VisitFlags implements Annotation {
-  }
-
   public static interface GeckoSession.MediaDelegate {
     method @UiThread default public void onMediaAdd(@NonNull GeckoSession, @NonNull MediaElement);
     method @UiThread default public void onMediaRemove(@NonNull GeckoSession, @NonNull MediaElement);
   }
 
   public static interface GeckoSession.NavigationDelegate {
     method @UiThread default public void onCanGoBack(@NonNull GeckoSession, boolean);
     method @UiThread default public void onCanGoForward(@NonNull GeckoSession, boolean);
@@ -539,19 +535,16 @@ package org.mozilla.geckoview {
   public static class GeckoSession.NavigationDelegate.LoadRequest {
     ctor protected LoadRequest();
     field public final boolean isRedirect;
     field public final int target;
     field @Nullable public final String triggerUri;
     field @NonNull public final String uri;
   }
 
-  public static interface GeckoSession.NavigationDelegate.TargetWindow implements Annotation {
-  }
-
   public static interface GeckoSession.PermissionDelegate {
     method @UiThread default public void onAndroidPermissionsRequest(@NonNull GeckoSession, @Nullable String[], @NonNull GeckoSession.PermissionDelegate.Callback);
     method @UiThread default public void onContentPermissionRequest(@NonNull GeckoSession, @Nullable String, int, @NonNull GeckoSession.PermissionDelegate.Callback);
     method @UiThread default public void onMediaPermissionRequest(@NonNull GeckoSession, @NonNull String, @Nullable GeckoSession.PermissionDelegate.MediaSource[], @Nullable GeckoSession.PermissionDelegate.MediaSource[], @NonNull GeckoSession.PermissionDelegate.MediaCallback);
     field public static final int PERMISSION_DESKTOP_NOTIFICATION = 1;
     field public static final int PERMISSION_GEOLOCATION = 0;
   }
 
@@ -580,19 +573,16 @@ package org.mozilla.geckoview {
     field public static final int TYPE_VIDEO = 0;
     field @NonNull public final String id;
     field @Nullable public final String name;
     field @NonNull public final String rawId;
     field public final int source;
     field public final int type;
   }
 
-  public static interface GeckoSession.PermissionDelegate.Permission implements Annotation {
-  }
-
   public static interface GeckoSession.ProgressDelegate {
     method @UiThread default public void onPageStart(@NonNull GeckoSession, @NonNull String);
     method @UiThread default public void onPageStop(@NonNull GeckoSession, boolean);
     method @UiThread default public void onProgressChange(@NonNull GeckoSession, int);
     method @UiThread default public void onSecurityChange(@NonNull GeckoSession, @NonNull GeckoSession.ProgressDelegate.SecurityInformation);
     method @UiThread default public void onSessionStateChange(@NonNull GeckoSession, @NonNull GeckoSession.SessionState);
   }
 
@@ -689,27 +679,21 @@ package org.mozilla.geckoview {
 
   public static interface GeckoSession.PromptDelegate.ChoiceCallback implements GeckoSession.PromptDelegate.AlertCallback {
     method @UiThread default public void confirm(@Nullable String);
     method @UiThread default public void confirm(@NonNull String[]);
     method @UiThread default public void confirm(@NonNull GeckoSession.PromptDelegate.Choice);
     method @UiThread default public void confirm(@Nullable GeckoSession.PromptDelegate.Choice[]);
   }
 
-  public static interface GeckoSession.PromptDelegate.DatetimeType implements Annotation {
-  }
-
   public static interface GeckoSession.PromptDelegate.FileCallback implements GeckoSession.PromptDelegate.AlertCallback {
     method @UiThread default public void confirm(@Nullable Context, @Nullable Uri);
     method @UiThread default public void confirm(@Nullable Context, @Nullable Uri[]);
   }
 
-  public static interface GeckoSession.PromptDelegate.FileType implements Annotation {
-  }
-
   public static interface GeckoSession.PromptDelegate.TextCallback implements GeckoSession.PromptDelegate.AlertCallback {
     method @UiThread default public void confirm(@Nullable String);
   }
 
   public static interface GeckoSession.ScrollDelegate {
     method @UiThread default public void onScrollChanged(@NonNull GeckoSession, int, int);
   }
 
@@ -729,25 +713,16 @@ package org.mozilla.geckoview {
     field public static final int FLAG_IS_EDITABLE = 2;
     field public static final int FLAG_IS_PASSWORD = 4;
     field public static final int HIDE_REASON_ACTIVE_SCROLL = 3;
     field public static final int HIDE_REASON_ACTIVE_SELECTION = 2;
     field public static final int HIDE_REASON_INVISIBLE_SELECTION = 1;
     field public static final int HIDE_REASON_NO_SELECTION = 0;
   }
 
-  public static interface GeckoSession.SelectionActionDelegate.Action implements Annotation {
-  }
-
-  public static interface GeckoSession.SelectionActionDelegate.Flag implements Annotation {
-  }
-
-  public static interface GeckoSession.SelectionActionDelegate.HideReason implements Annotation {
-  }
-
   public static class GeckoSession.SelectionActionDelegate.Selection {
     ctor protected Selection();
     field @Nullable public final RectF clientRect;
     field public final int flags;
     field @NonNull public final String text;
   }
 
   @AnyThread public static class GeckoSession.SessionState extends AbstractSequentialList implements GeckoSession.HistoryDelegate.HistoryList Parcelable {
@@ -773,22 +748,16 @@ package org.mozilla.geckoview {
     field public static final int AUTO_FILL_NOTIFY_VIEW_EXITED = 7;
     field public static final int AUTO_FILL_NOTIFY_VIEW_REMOVED = 4;
     field public static final int AUTO_FILL_NOTIFY_VIEW_UPDATED = 5;
     field public static final int RESTART_REASON_BLUR = 1;
     field public static final int RESTART_REASON_CONTENT_CHANGE = 2;
     field public static final int RESTART_REASON_FOCUS = 0;
   }
 
-  public static interface GeckoSession.TextInputDelegate.AutoFillNotification implements Annotation {
-  }
-
-  public static interface GeckoSession.TextInputDelegate.RestartReason implements Annotation {
-  }
-
   @AnyThread public static class GeckoSession.WebResponseInfo {
     ctor protected WebResponseInfo();
     field @Nullable public final long contentLength;
     field @Nullable public final String contentType;
     field @Nullable public final String filename;
     field @NonNull public final String uri;
   }
 
@@ -879,19 +848,16 @@ package org.mozilla.geckoview {
     method @NonNull public GeckoResult<WebResponse> fetch(@NonNull WebRequest, int);
     method @NonNull public GeckoResult<InetAddress[]> resolve(@NonNull String);
     method public void speculativeConnect(@NonNull String);
     field public static final int FETCH_FLAGS_ANONYMOUS = 1;
     field public static final int FETCH_FLAGS_NONE = 0;
     field public static final int FETCH_FLAGS_NO_REDIRECTS = 2;
   }
 
-  public static interface GeckoWebExecutor.FetchFlags implements Annotation {
-  }
-
   @AnyThread public class MediaElement {
     method @Nullable public MediaElement.Delegate getDelegate();
     method public void pause();
     method public void play();
     method public void seek(double);
     method public void setDelegate(@Nullable MediaElement.Delegate);
     method public void setMuted(boolean);
     method public void setPlaybackRate(double);
@@ -1127,19 +1093,16 @@ package org.mozilla.geckoview {
     ctor public Builder(@NonNull String);
     method @NonNull public WebRequest.Builder body(@Nullable ByteBuffer);
     method @NonNull public WebRequest build();
     method @NonNull public WebRequest.Builder cacheMode(int);
     method @NonNull public WebRequest.Builder method(@NonNull String);
     method @NonNull public WebRequest.Builder referrer(@Nullable String);
   }
 
-  public static interface WebRequest.CacheMode implements Annotation {
-  }
-
   @AnyThread public class WebRequestError extends Exception {
     ctor public WebRequestError(int, int);
     field public static final int ERROR_CATEGORY_CONTENT = 4;
     field public static final int ERROR_CATEGORY_NETWORK = 3;
     field public static final int ERROR_CATEGORY_PROXY = 6;
     field public static final int ERROR_CATEGORY_SAFEBROWSING = 7;
     field public static final int ERROR_CATEGORY_SECURITY = 2;
     field public static final int ERROR_CATEGORY_UNKNOWN = 1;
@@ -1169,22 +1132,16 @@ package org.mozilla.geckoview {
     field public static final int ERROR_UNKNOWN_PROTOCOL = 69;
     field public static final int ERROR_UNKNOWN_PROXY_HOST = 54;
     field public static final int ERROR_UNKNOWN_SOCKET_TYPE = 83;
     field public static final int ERROR_UNSAFE_CONTENT_TYPE = 36;
     field public final int category;
     field public final int code;
   }
 
-  public static interface WebRequestError.Error implements Annotation {
-  }
-
-  public static interface WebRequestError.ErrorCategory implements Annotation {
-  }
-
   @AnyThread public class WebResponse extends WebMessage {
     ctor protected WebResponse(@NonNull WebResponse.Builder);
     field @Nullable public final InputStream body;
     field public final boolean redirected;
     field public final int statusCode;
   }
 
   @AnyThread public static class WebResponse.Builder extends WebMessage.Builder {
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExecutorTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExecutorTest.kt
@@ -80,17 +80,17 @@ class WebExecutorTest {
     fun cleanup() {
         server.stop()
     }
 
     private fun fetch(request: WebRequest): WebResponse {
         return fetch(request, GeckoWebExecutor.FETCH_FLAGS_NONE)
     }
 
-    private fun fetch(request: WebRequest, @GeckoWebExecutor.FetchFlags flags: Int): WebResponse {
+    private fun fetch(request: WebRequest, flags: Int): WebResponse {
         return executor.fetch(request, flags).poll(env.defaultTimeoutMillis)!!
     }
 
     fun String.toDirectByteBuffer(): ByteBuffer {
         val chars = CharBuffer.wrap(this)
         val buffer = ByteBuffer.allocateDirect(this.length)
         Charset.forName("UTF-8").newEncoder().encode(chars, buffer, true)
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
@@ -1468,17 +1468,17 @@ import android.view.inputmethod.EditorIn
             icRestartInput(GeckoSession.TextInputDelegate.RESTART_REASON_FOCUS,
                            /* toggleSoftInput */ true);
         } else if (oldState != SessionTextInput.EditableListener.IME_STATE_DISABLED) {
             icRestartInput(GeckoSession.TextInputDelegate.RESTART_REASON_CONTENT_CHANGE,
                            /* toggleSoftInput */ false);
         }
     }
 
-    private void icRestartInput(@GeckoSession.TextInputDelegate.RestartReason final int reason,
+    private void icRestartInput(@GeckoSession.RestartReason final int reason,
                                 final boolean toggleSoftInput) {
         if (DEBUG) {
             assertOnIcThread();
         }
 
         ThreadUtils.postToUiThread(new Runnable() {
             @Override
             public void run() {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -802,17 +802,17 @@ public class GeckoSession implements Par
             public void handleMessage(final SelectionActionDelegate delegate,
                                       final String event,
                                       final GeckoBundle message,
                                       final EventCallback callback) {
                 if ("GeckoView:ShowSelectionAction".equals(event)) {
                     final SelectionActionDelegate.Selection selection =
                             new SelectionActionDelegate.Selection(message);
 
-                    final @SelectionActionDelegate.Action String[] actions = message.getStringArray("actions");
+                    final @SelectionActionDelegateAction String[] actions = message.getStringArray("actions");
                     final int seqNo = message.getInt("seqNo");
                     final GeckoResponse<String> response = new GeckoResponse<String>() {
                         @Override
                         public void respond(final String action) {
                             final GeckoBundle response = new GeckoBundle(2);
                             response.putString("id", action);
                             response.putInt("seqNo", seqNo);
                             callback.sendSuccess(response);
@@ -3150,47 +3150,30 @@ public class GeckoSession implements Par
          * @param manifest A parsed and validated {@link JSONObject} containing the manifest contents.
          * @see <a href="https://www.w3.org/TR/appmanifest/">Web App Manifest specification</a>
          */
         @UiThread
         default void onWebAppManifest(@NonNull GeckoSession session, @NonNull JSONObject manifest) {}
     }
 
     public interface SelectionActionDelegate {
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef(flag = true, value = {FLAG_IS_COLLAPSED,
-                                      FLAG_IS_EDITABLE})
-        /* package */ @interface Flag {}
-
         /**
          * The selection is collapsed at a single position.
          */
         final int FLAG_IS_COLLAPSED = 1;
         /**
          * The selection is inside editable content such as an input element or
          * contentEditable node.
          */
         final int FLAG_IS_EDITABLE = 2;
         /**
          * The selection is inside a password field.
          */
         final int FLAG_IS_PASSWORD = 4;
 
-        @Retention(RetentionPolicy.SOURCE)
-        @StringDef({ACTION_HIDE,
-                    ACTION_CUT,
-                    ACTION_COPY,
-                    ACTION_DELETE,
-                    ACTION_PASTE,
-                    ACTION_SELECT_ALL,
-                    ACTION_UNSELECT,
-                    ACTION_COLLAPSE_TO_START,
-                    ACTION_COLLAPSE_TO_END})
-        /* package */ @interface Action {}
-
         /**
          * Hide selection actions and cause {@link #onHideAction} to be called.
          */
         final String ACTION_HIDE = "org.mozilla.geckoview.HIDE";
         /**
          * Copy onto the clipboard then delete the selected content. Selection
          * must be editable.
          */
@@ -3230,17 +3213,17 @@ public class GeckoSession implements Par
         /**
          * Represents attributes of a selection.
          */
         class Selection {
             /**
              * Flags describing the current selection, as a bitwise combination
              * of the {@link #FLAG_IS_COLLAPSED FLAG_*} constants.
              */
-            public final @Flag int flags;
+            public final @SelectionActionDelegateFlag int flags;
 
             /**
              * Text content of the current selection. An empty string indicates the selection
              * is collapsed or the selection cannot be represented as plain text.
              */
             public final @NonNull String text;
 
             /**
@@ -3300,26 +3283,19 @@ public class GeckoSession implements Par
          * @param actions Array of built-in actions available; possible values
          * come from the {@link #ACTION_HIDE ACTION_*} constants.
          * @param response Callback object for performing built-in actions. For example,
          * {@code response.respond(actions[0])} performs the first action. May be used
          * multiple times to perform multiple actions at once.
          */
         @UiThread
         default void onShowActionRequest(@NonNull GeckoSession session, @NonNull Selection selection,
-                                         @NonNull @Action String[] actions,
+                                         @NonNull @SelectionActionDelegateAction String[] actions,
                                          @NonNull GeckoResponse<String> response) {}
 
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef({HIDE_REASON_NO_SELECTION,
-                 HIDE_REASON_INVISIBLE_SELECTION,
-                 HIDE_REASON_ACTIVE_SELECTION,
-                 HIDE_REASON_ACTIVE_SCROLL})
-        /* package */ @interface HideReason {}
-
         /**
          * Actions are no longer available due to the user clearing the selection.
          */
         final int HIDE_REASON_NO_SELECTION = 0;
         /**
          * Actions are no longer available due to the user moving the selection out of view.
          * Previous actions are still available after a callback with this reason.
          */
@@ -3342,19 +3318,47 @@ public class GeckoSession implements Par
          * Previous actions are no longer available due to the user interacting with the
          * page. Applications typically hide the action toolbar in response.
          *
          * @param session The GeckoSession that initiated the callback.
          * @param reason The reason that actions are no longer available, as one of the
          * {@link #HIDE_REASON_NO_SELECTION HIDE_REASON_*} constants.
          */
         @UiThread
-        default void onHideAction(@NonNull GeckoSession session, @HideReason int reason) {}
+        default void onHideAction(@NonNull GeckoSession session,
+                                  @SelectionActionDelegateHideReason int reason) {}
     }
 
+    @Retention(RetentionPolicy.SOURCE)
+    @StringDef({
+            SelectionActionDelegate.ACTION_HIDE,
+            SelectionActionDelegate.ACTION_CUT,
+            SelectionActionDelegate.ACTION_COPY,
+            SelectionActionDelegate.ACTION_DELETE,
+            SelectionActionDelegate.ACTION_PASTE,
+            SelectionActionDelegate.ACTION_SELECT_ALL,
+            SelectionActionDelegate.ACTION_UNSELECT,
+            SelectionActionDelegate.ACTION_COLLAPSE_TO_START,
+            SelectionActionDelegate.ACTION_COLLAPSE_TO_END})
+    /* package */ @interface SelectionActionDelegateAction {}
+
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef(flag = true, value = {
+            SelectionActionDelegate.FLAG_IS_COLLAPSED,
+            SelectionActionDelegate.FLAG_IS_EDITABLE})
+            /* package */ @interface SelectionActionDelegateFlag {}
+
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({
+            SelectionActionDelegate.HIDE_REASON_NO_SELECTION,
+            SelectionActionDelegate.HIDE_REASON_INVISIBLE_SELECTION,
+            SelectionActionDelegate.HIDE_REASON_ACTIVE_SELECTION,
+            SelectionActionDelegate.HIDE_REASON_ACTIVE_SCROLL})
+    /* package */ @interface SelectionActionDelegateHideReason {}
+
     public interface NavigationDelegate {
         /**
         * A view has started loading content from the network.
         * @param session The GeckoSession that initiated the callback.
         * @param url The resource being loaded.
         */
         @UiThread
         default void onLocationChange(@NonNull GeckoSession session, @Nullable String url) {}
@@ -3370,19 +3374,16 @@ public class GeckoSession implements Par
         /**
         * The view's ability to go forward has changed.
         * @param session The GeckoSession that initiated the callback.
         * @param canGoForward The new value for the ability.
         */
         @UiThread
         default void onCanGoForward(@NonNull GeckoSession session, boolean canGoForward) {}
 
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef({TARGET_WINDOW_NONE, TARGET_WINDOW_CURRENT, TARGET_WINDOW_NEW})
-        /* package */ @interface TargetWindow {}
         public static final int TARGET_WINDOW_NONE = 0;
         public static final int TARGET_WINDOW_CURRENT = 1;
         public static final int TARGET_WINDOW_NEW = 2;
 
         // Match with nsIWebNavigation.idl.
         /**
          * The load request was triggered by an HTTP redirect.
          */
@@ -3494,16 +3495,21 @@ public class GeckoSession implements Par
         @UiThread
         default @Nullable GeckoResult<String> onLoadError(@NonNull GeckoSession session,
                                                           @Nullable String uri,
                                                           @NonNull WebRequestError error) {
             return null;
         }
     }
 
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({NavigationDelegate.TARGET_WINDOW_NONE, NavigationDelegate.TARGET_WINDOW_CURRENT,
+            NavigationDelegate.TARGET_WINDOW_NEW})
+    /* package */ @interface TargetWindow {}
+
     /**
      * GeckoSession applications implement this interface to handle prompts triggered by
      * content in the GeckoSession, such as alerts, authentication dialogs, and select list
      * pickers.
      **/
     public interface PromptDelegate {
         /**
          * Callback interface for notifying the result of a prompt, and for accessing the
@@ -3938,21 +3944,16 @@ public class GeckoSession implements Par
          *                 HTML color format.
          */
         @UiThread
         default void onColorPrompt(@NonNull GeckoSession session, @Nullable String title,
                                    @Nullable String value, @NonNull TextCallback callback) {
             callback.dismiss();
         }
 
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef({DATETIME_TYPE_DATE, DATETIME_TYPE_MONTH, DATETIME_TYPE_WEEK,
-                 DATETIME_TYPE_TIME, DATETIME_TYPE_DATETIME_LOCAL})
-        /* package */ @interface DatetimeType {}
-
         /**
          * Prompt for year, month, and day.
          */
         static final int DATETIME_TYPE_DATE = 1;
 
         /**
          * Prompt for year and month.
          */
@@ -4012,19 +4013,16 @@ public class GeckoSession implements Par
              *
              * @param context An application Context for parsing URIs.
              * @param uris Array of URI objects for the selected files.
              */
             @UiThread
             default void confirm(@Nullable Context context, @Nullable Uri[] uris) {}
         }
 
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef({FILE_TYPE_SINGLE, FILE_TYPE_MULTIPLE})
-        /* package */ @interface FileType {}
         static final int FILE_TYPE_SINGLE = 1;
         static final int FILE_TYPE_MULTIPLE = 2;
 
         /**
          * Display a file prompt.
          *
          * @param session GeckoSession that triggered the prompt
          * @param title Title for the prompt dialog.
@@ -4054,16 +4052,26 @@ public class GeckoSession implements Par
          */
         @UiThread
         default @Nullable GeckoResult<AllowOrDeny> onPopupRequest(@NonNull GeckoSession session,
                                                                   @Nullable String targetUri) {
             return null;
         }
     }
 
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({PromptDelegate.FILE_TYPE_SINGLE, PromptDelegate.FILE_TYPE_MULTIPLE})
+            /* package */ @interface FileType {}
+
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({PromptDelegate.DATETIME_TYPE_DATE, PromptDelegate.DATETIME_TYPE_MONTH,
+            PromptDelegate.DATETIME_TYPE_WEEK, PromptDelegate.DATETIME_TYPE_TIME,
+            PromptDelegate.DATETIME_TYPE_DATETIME_LOCAL})
+    /* package */ @interface DatetimeType {}
+
     /**
      * GeckoSession applications implement this interface to handle content scroll
      * events.
      **/
     public interface ScrollDelegate {
         /**
          * The scroll position of the content has changed.
          *
@@ -4243,20 +4251,16 @@ public class GeckoSession implements Par
      * permission dialog.
      *
      *
      * When denying an Android app permission, the response is not stored by GeckoView.
      * It is the responsibility of the consumer to store the response state and therefore prevent
      * further requests from being presented to the user.
      **/
     public interface PermissionDelegate {
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef({PERMISSION_GEOLOCATION, PERMISSION_DESKTOP_NOTIFICATION})
-        /* package */ @interface Permission {}
-
         /**
          * Permission for using the geolocation API.
          * See: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation
          */
         int PERMISSION_GEOLOCATION = 0;
 
         /**
          * Permission for using the notifications API.
@@ -4520,26 +4524,27 @@ public class GeckoSession implements Par
         @UiThread
         default void onMediaPermissionRequest(@NonNull GeckoSession session, @NonNull String uri,
                                               @Nullable MediaSource[] video, @Nullable MediaSource[] audio,
                                               @NonNull MediaCallback callback) {
             callback.reject();
         }
     }
 
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({PermissionDelegate.PERMISSION_GEOLOCATION,
+            PermissionDelegate.PERMISSION_DESKTOP_NOTIFICATION})
+    /* package */ @interface Permission {}
+
     /**
      * Interface that SessionTextInput uses for performing operations such as opening and closing
      * the software keyboard. If the delegate is not set, these operations are forwarded to the
      * system {@link android.view.inputmethod.InputMethodManager} automatically.
      */
     public interface TextInputDelegate {
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef({RESTART_REASON_FOCUS, RESTART_REASON_BLUR, RESTART_REASON_CONTENT_CHANGE})
-        /* package */ @interface RestartReason {}
-
         /** Restarting input due to an input field gaining focus. */
         int RESTART_REASON_FOCUS = 0;
         /** Restarting input due to an input field losing focus. */
         int RESTART_REASON_BLUR = 1;
         /**
          * Restarting input due to the content of the input field changing. For example, the
          * input field type may have changed, or the current composition may have been committed
          * outside of the input method.
@@ -4617,23 +4622,16 @@ public class GeckoSession implements Par
          *
          * @param session Session instance.
          * @param info Cursor-anchor information.
          */
         @UiThread
         default void updateCursorAnchorInfo(@NonNull GeckoSession session,
                                             @NonNull CursorAnchorInfo info) {}
 
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef({AUTO_FILL_NOTIFY_STARTED, AUTO_FILL_NOTIFY_COMMITTED, AUTO_FILL_NOTIFY_CANCELED,
-                AUTO_FILL_NOTIFY_VIEW_ADDED, AUTO_FILL_NOTIFY_VIEW_REMOVED,
-                AUTO_FILL_NOTIFY_VIEW_UPDATED, AUTO_FILL_NOTIFY_VIEW_ENTERED,
-                AUTO_FILL_NOTIFY_VIEW_EXITED})
-        /* package */ @interface AutoFillNotification {}
-
         /** An auto-fill session has started, usually as a result of loading a page. */
         int AUTO_FILL_NOTIFY_STARTED = 0;
         /** An auto-fill session has been committed, usually as a result of submitting a form. */
         int AUTO_FILL_NOTIFY_COMMITTED = 1;
         /** An auto-fill session has been canceled, usually as a result of unloading a page. */
         int AUTO_FILL_NOTIFY_CANCELED = 2;
         /** A view within the auto-fill session has been added. */
         int AUTO_FILL_NOTIFY_VIEW_ADDED = 3;
@@ -4660,16 +4658,33 @@ public class GeckoSession implements Par
          *                  with {@link SessionTextInput#autofill}.
          */
         @UiThread
         default void notifyAutoFill(@NonNull GeckoSession session,
                                     @AutoFillNotification int notification,
                                     int virtualId) {}
     }
 
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({TextInputDelegate.RESTART_REASON_FOCUS, TextInputDelegate.RESTART_REASON_BLUR,
+            TextInputDelegate.RESTART_REASON_CONTENT_CHANGE})
+            /* package */ @interface RestartReason {}
+
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({
+            TextInputDelegate.AUTO_FILL_NOTIFY_STARTED,
+            TextInputDelegate.AUTO_FILL_NOTIFY_COMMITTED,
+            TextInputDelegate.AUTO_FILL_NOTIFY_CANCELED,
+            TextInputDelegate.AUTO_FILL_NOTIFY_VIEW_ADDED,
+            TextInputDelegate.AUTO_FILL_NOTIFY_VIEW_REMOVED,
+            TextInputDelegate.AUTO_FILL_NOTIFY_VIEW_UPDATED,
+            TextInputDelegate.AUTO_FILL_NOTIFY_VIEW_ENTERED,
+            TextInputDelegate.AUTO_FILL_NOTIFY_VIEW_EXITED})
+    /* package */ @interface AutoFillNotification {}
+
     /* package */ void onSurfaceChanged(final Surface surface, final int x, final int y, final int width,
                                         final int height) {
         ThreadUtils.assertOnUiThread();
 
         mOffsetX = x;
         mOffsetY = y;
         mWidth = width;
         mHeight = height;
@@ -4962,24 +4977,16 @@ public class GeckoSession implements Par
              * @return An int representing the current index in browser history.
              */
             @AnyThread
             default int getCurrentIndex() {
                 throw new UnsupportedOperationException("HistoryList.getCurrentIndex() called on invalid object.");
             }
         }
 
-        @Retention(RetentionPolicy.SOURCE)
-        @IntDef(flag = true,
-                value = { VISIT_TOP_LEVEL,
-                          VISIT_REDIRECT_TEMPORARY, VISIT_REDIRECT_PERMANENT,
-                          VISIT_REDIRECT_SOURCE, VISIT_REDIRECT_SOURCE_PERMANENT,
-                          VISIT_UNRECOVERABLE_ERROR })
-        /* package */ @interface VisitFlags {}
-
         // These flags are similar to those in `IHistory::LoadFlags`, but we use
         // different values to decouple GeckoView from Gecko changes. These
         // should be kept in sync with `GeckoViewHistory::GeckoViewVisitFlags`.
 
         /** The URL was visited a top-level window. */
         final int VISIT_TOP_LEVEL = 1 << 0;
         /** The URL is the target of a temporary redirect. */
         final int VISIT_REDIRECT_TEMPORARY = 1 << 1;
@@ -5029,9 +5036,21 @@ public class GeckoSession implements Par
         default @Nullable GeckoResult<boolean[]> getVisited(@NonNull GeckoSession session,
                                                             @NonNull String[] urls) {
             return null;
         }
 
         @UiThread
         default void onHistoryStateChange(@NonNull GeckoSession session, @NonNull HistoryList historyList) {}
     }
+
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef(flag = true,
+            value = {
+                HistoryDelegate.VISIT_TOP_LEVEL,
+                HistoryDelegate.VISIT_REDIRECT_TEMPORARY,
+                HistoryDelegate.VISIT_REDIRECT_PERMANENT,
+                HistoryDelegate.VISIT_REDIRECT_SOURCE,
+                HistoryDelegate.VISIT_REDIRECT_SOURCE_PERMANENT,
+                HistoryDelegate.VISIT_UNRECOVERABLE_ERROR
+            })
+    /* package */ @interface VisitFlags {}
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoWebExecutor.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoWebExecutor.java
@@ -50,17 +50,17 @@ public class GeckoWebExecutor {
 
     @WrapForJNI(calledFrom = "gecko", exceptionMode = "nsresult")
     private static ByteBuffer createByteBuffer(final int capacity) {
         return ByteBuffer.allocateDirect(capacity);
     }
 
     @Retention(RetentionPolicy.SOURCE)
     @IntDef({FETCH_FLAGS_NONE, FETCH_FLAGS_ANONYMOUS, FETCH_FLAGS_NO_REDIRECTS})
-    public @interface FetchFlags {};
+    /* package */ @interface FetchFlags {};
 
     /**
      * No special treatment.
      */
     public static final int FETCH_FLAGS_NONE = 0;
 
     /**
      * Don't send cookies or other user data along with the request.
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
@@ -271,17 +271,17 @@ public final class SessionTextInput {
                 contentRect = getDummyAutoFillRect(session, true, view);
             }
 
             return contentRect;
         }
 
         @Override
         public void notifyAutoFill(@NonNull final GeckoSession session,
-                                   @AutoFillNotification final int notification,
+                                   @GeckoSession.AutoFillNotification final int notification,
                                    final int virtualId) {
             ThreadUtils.assertOnUiThread();
             final View view = session.getTextInput().getView();
             if (Build.VERSION.SDK_INT < 26 || view == null) {
                 return;
             }
 
             final AutofillManager manager =
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequest.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequest.java
@@ -48,17 +48,17 @@ public class WebRequest extends WebMessa
      * The value of the Referer header for this request.
      */
     public final @Nullable String referrer;
 
     @Retention(RetentionPolicy.SOURCE)
     @IntDef({CACHE_MODE_DEFAULT, CACHE_MODE_NO_STORE,
             CACHE_MODE_RELOAD, CACHE_MODE_NO_CACHE,
             CACHE_MODE_FORCE_CACHE, CACHE_MODE_ONLY_IF_CACHED})
-    public @interface CacheMode {};
+    /* package */ @interface CacheMode {};
 
     /**
      * Default cache mode. Normal caching rules apply.
      */
     public static final int CACHE_MODE_DEFAULT = 1;
 
     /**
      * The response will be fetched from the server without looking in
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequestError.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequestError.java
@@ -21,32 +21,32 @@ import java.lang.annotation.RetentionPol
  */
 @AnyThread
 public class WebRequestError extends Exception {
     @Retention(RetentionPolicy.SOURCE)
     @IntDef({ERROR_CATEGORY_UNKNOWN, ERROR_CATEGORY_SECURITY,
             ERROR_CATEGORY_NETWORK, ERROR_CATEGORY_CONTENT,
             ERROR_CATEGORY_URI, ERROR_CATEGORY_PROXY,
             ERROR_CATEGORY_SAFEBROWSING})
-    public @interface ErrorCategory {}
+    /* package */ @interface ErrorCategory {}
 
     @Retention(RetentionPolicy.SOURCE)
     @IntDef({ERROR_UNKNOWN, ERROR_SECURITY_SSL, ERROR_SECURITY_BAD_CERT,
             ERROR_NET_RESET, ERROR_NET_INTERRUPT, ERROR_NET_TIMEOUT,
             ERROR_CONNECTION_REFUSED, ERROR_UNKNOWN_PROTOCOL,
             ERROR_UNKNOWN_HOST, ERROR_UNKNOWN_SOCKET_TYPE,
             ERROR_UNKNOWN_PROXY_HOST, ERROR_MALFORMED_URI,
             ERROR_REDIRECT_LOOP, ERROR_SAFEBROWSING_PHISHING_URI,
             ERROR_SAFEBROWSING_MALWARE_URI, ERROR_SAFEBROWSING_UNWANTED_URI,
             ERROR_SAFEBROWSING_HARMFUL_URI, ERROR_CONTENT_CRASHED,
             ERROR_OFFLINE, ERROR_PORT_BLOCKED,
             ERROR_PROXY_CONNECTION_REFUSED, ERROR_FILE_NOT_FOUND,
             ERROR_FILE_ACCESS_DENIED, ERROR_INVALID_CONTENT_ENCODING,
             ERROR_UNSAFE_CONTENT_TYPE, ERROR_CORRUPTED_CONTENT})
-    public @interface Error {}
+    /* package */ @interface Error {}
 
     /**
      * This is normally used for error codes that don't
      * currently fit into any of the other categories.
      */
     public static final int ERROR_CATEGORY_UNKNOWN = 0x1;
 
     /**
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
@@ -299,9 +299,9 @@ exclude: true
 [65.23]: ../GeckoSession.FinderResult.html
 
 - Update [`CrashReporter#sendCrashReport`][65.24] to return the crash ID as a
   [`GeckoResult<String>`][65.25].
 
 [65.24]: ../CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
 [65.25]: ../GeckoResult.html
 
-[api-version]: d51e6bd6f7fe004cbe5856e892ec538e2404c3fc
+[api-version]: 3fbf9d92418d270558cefad65cfe00599aeae263