Bug 1502118 - Add @UiThread to GeckoSession.TextInputDelegate. r=snorp.
authorAgi Sferro <agi@mozilla.com>
Tue, 30 Oct 2018 15:55:24 +0000
changeset 443542 c26e3232d3a3fc5c4c15eb60036a139db763e5f6
parent 443541 aed3a7740a8624be2835e3e87247d39a84b293f2
child 443543 6434abf7d80653b0ef8c7cc24fc849c83f51c9a5
push id34961
push useraciure@mozilla.com
push dateTue, 30 Oct 2018 22:06:02 +0000
treeherdermozilla-central@a9bd3dd38b19 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1502118
milestone65.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 1502118 - Add @UiThread to GeckoSession.TextInputDelegate. r=snorp. Depends on D10240 Differential Revision: https://phabricator.services.mozilla.com/D10241
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -3541,70 +3541,76 @@ public class GeckoSession extends LayerS
          * Note that {@code restartInput} should be used to detect changes in focus, rather than
          * {@link #showSoftInput} or {@link #hideSoftInput}, because focus changes are not always
          * accompanied by requests to show or hide the soft input. This method is always called,
          * even in viewless mode.
          *
          * @param session Session instance.
          * @param reason Reason for the reset.
          */
+        @UiThread
         void restartInput(@NonNull GeckoSession session, @RestartReason int reason);
 
         /**
          * Display the soft input. May be called consecutively, even if the soft input is
          * already shown. This method is always called, even in viewless mode.
          *
          * @param session Session instance.
          * @see #hideSoftInput
          * */
+        @UiThread
         void showSoftInput(@NonNull GeckoSession session);
 
         /**
          * Hide the soft input. May be called consecutively, even if the soft input is
          * already hidden. This method is always called, even in viewless mode.
          *
          * @param session Session instance.
          * @see #showSoftInput
          * */
+        @UiThread
         void hideSoftInput(@NonNull GeckoSession session);
 
         /**
          * Update the soft input on the current selection. This method is <i>not</i> called
          * in viewless mode.
          *
          * @param session Session instance.
          * @param selStart Start offset of the selection.
          * @param selEnd End offset of the selection.
          * @param compositionStart Composition start offset, or -1 if there is no composition.
          * @param compositionEnd Composition end offset, or -1 if there is no composition.
          */
+        @UiThread
         void updateSelection(@NonNull GeckoSession session, int selStart, int selEnd,
                              int compositionStart, int compositionEnd);
 
         /**
          * Update the soft input on the current extracted text, as requested through
          * {@link android.view.inputmethod.InputConnection#getExtractedText}.
          * Consequently, this method is <i>not</i> called in viewless mode.
          *
          * @param session Session instance.
          * @param request The extract text request.
          * @param text The extracted text.
          */
+        @UiThread
         void updateExtractedText(@NonNull GeckoSession session,
                                  @NonNull ExtractedTextRequest request,
                                  @NonNull ExtractedText text);
 
         /**
          * Update the cursor-anchor information as requested through
          * {@link android.view.inputmethod.InputConnection#requestCursorUpdates}.
          * Consequently, this method is <i>not</i> called in viewless mode.
          *
          * @param session Session instance.
          * @param info Cursor-anchor information.
          */
+        @UiThread
         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 {}
@@ -3634,12 +3640,13 @@ public class GeckoSession extends LayerS
          * @param session Session instance.
          * @param notification Notification type as one of the {@link #AUTO_FILL_NOTIFY_STARTED
          *                     AUTO_FILL_NOTIFY_*} constants.
          * @param virtualId Virtual ID of the target, or {@link android.view.View#NO_ID} if not
          *                  applicable. The ID matches one of the virtual IDs provided by {@link
          *                  SessionTextInput#onProvideAutofillVirtualStructure} and can be used
          *                  with {@link SessionTextInput#autofill}.
          */
+        @UiThread
         void notifyAutoFill(@NonNull GeckoSession session, @AutoFillNotification int notification,
                             int virtualId);
     }
 }