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

Commit ed76866d authored by Felix Stern's avatar Felix Stern
Browse files

Adding new ImeTracker phases for receiving new controls

Bug: 326377046
Flag: android.view.inputmethod.refactor_insets_controller
Test: None, logs only
Change-Id: If4ee73116bcbca87ea64a30bc99b2da7aef2e8db
parent 3da7bfe6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1030,10 +1030,18 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
                handlePendingControlRequest(statsToken);
            } else {
                if (showTypes[0] != 0) {
                    if ((showTypes[0] & ime()) != 0) {
                        ImeTracker.forLogging().onProgress(statsToken,
                                ImeTracker.PHASE_CLIENT_ON_CONTROLS_CHANGED);
                    }
                    applyAnimation(showTypes[0], true /* show */, false /* fromIme */,
                            false /* skipsCallbacks */, statsToken);
                }
                if (hideTypes[0] != 0) {
                    if ((hideTypes[0] & ime()) != 0) {
                        ImeTracker.forLogging().onProgress(statsToken,
                                ImeTracker.PHASE_CLIENT_ON_CONTROLS_CHANGED);
                    }
                    applyAnimation(hideTypes[0], false /* show */, false /* fromIme */,
                            // The animation of hiding transient types shouldn't be detected by the
                            // app. Otherwise, it might be able to react to the callbacks and cause
@@ -1041,6 +1049,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
                            (hideTypes[0] & ~transientTypes[0]) == 0 /* skipsCallbacks */,
                            statsToken);
                }
                if ((showTypes[0] & ime()) == 0 && (hideTypes[0] & ime()) == 0) {
                    ImeTracker.forLogging().onCancelled(statsToken,
                            ImeTracker.PHASE_CLIENT_ON_CONTROLS_CHANGED);
                }
            }
        } else {
            if (showTypes[0] != 0) {
+4 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ public interface ImeTracker {
            PHASE_WM_WINDOW_ANIMATING_TYPES_CHANGED,
            PHASE_WM_NOTIFY_HIDE_ANIMATION_FINISHED,
            PHASE_WM_UPDATE_DISPLAY_WINDOW_ANIMATING_TYPES,
            PHASE_CLIENT_ON_CONTROLS_CHANGED,
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface Phase {}
@@ -469,6 +470,9 @@ public interface ImeTracker {
    /** The control target reported its animatingTypes back to WindowManagerService. */
    int PHASE_WM_UPDATE_DISPLAY_WINDOW_ANIMATING_TYPES =
            ImeProtoEnums.PHASE_WM_UPDATE_DISPLAY_WINDOW_ANIMATING_TYPES;
    /** InsetsController received a control for the IME. */
    int PHASE_CLIENT_ON_CONTROLS_CHANGED =
            ImeProtoEnums.PHASE_CLIENT_ON_CONTROLS_CHANGED;

    /**
     * Called when an IME request is started.