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

Commit 202f2d4e authored by Felix Stern's avatar Felix Stern
Browse files

Adding ImeTracker cancellation if requestedVisibleTypes are unchanged

Bug: 353463205
Test: None, logs only
Flag: android.view.inputmethod.refactor_insets_controller
Change-Id: I408322fc33882bc5fc5d21cbde1dfd9aa533620f
parent 64cf3ae5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ public interface ImeTracker {
            PHASE_SERVER_UPDATE_CLIENT_VISIBILITY,
            PHASE_WM_DISPLAY_IME_CONTROLLER_SET_IME_REQUESTED_VISIBLE,
            PHASE_WM_UPDATE_DISPLAY_WINDOW_REQUESTED_VISIBLE_TYPES,
            PHASE_WM_REQUESTED_VISIBLE_TYPES_NOT_CHANGED,
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface Phase {}
@@ -445,6 +446,9 @@ public interface ImeTracker {
    /** The control target reported its requestedVisibleTypes back to WindowManagerService. */
    int PHASE_WM_UPDATE_DISPLAY_WINDOW_REQUESTED_VISIBLE_TYPES =
            ImeProtoEnums.PHASE_WM_UPDATE_DISPLAY_WINDOW_REQUESTED_VISIBLE_TYPES;
    /** The requestedVisibleTypes have not been changed, so this request is not continued. */
    int PHASE_WM_REQUESTED_VISIBLE_TYPES_NOT_CHANGED =
            ImeProtoEnums.PHASE_WM_REQUESTED_VISIBLE_TYPES_NOT_CHANGED;

    /**
     * Called when an IME request is started.
+5 −2
Original line number Diff line number Diff line
@@ -225,13 +225,16 @@ class InsetsStateController {
        for (int i = mProviders.size() - 1; i >= 0; i--) {
            final InsetsSourceProvider provider = mProviders.valueAt(i);
            final @InsetsType int type = provider.getSource().getType();
            if ((type & changedTypes) != 0) {
            final boolean isImeProvider = type == WindowInsets.Type.ime();
            if ((type & changedTypes) != 0) {
                changed |= provider.updateClientVisibility(
                        caller, isImeProvider ? statsToken : null)
                        // Fake control target cannot change the client visibility, but it should
                        // change the insets with its newly requested visibility.
                        || (caller == provider.getFakeControlTarget());
            } else if (isImeProvider && android.view.inputmethod.Flags.refactorInsetsController()) {
                ImeTracker.forLogging().onCancelled(statsToken,
                        ImeTracker.PHASE_WM_SET_REMOTE_TARGET_IME_VISIBILITY);
            }
        }
        if (changed) {