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

Commit 9e4888e7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Not relying on statsToken when Bubbles hides IME during screen lock" into main

parents 691ad7ea 72b16dfe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -307,6 +307,8 @@ public final class InputMethodDebug {
                return "HIDE_WINDOW_LOST_FOCUS";
            case SoftInputShowHideReason.IME_REQUESTED_CHANGED_LISTENER:
                return "IME_REQUESTED_CHANGED_LISTENER";
            case SoftInputShowHideReason.HIDE_FOR_BUBBLES_WHEN_LOCKED:
                return "HIDE_FOR_BUBBLES_WHEN_LOCKED";
            default:
                return "Unknown=" + reason;
        }
+4 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ import java.lang.annotation.Retention;
        SoftInputShowHideReason.HIDE_INPUT_TARGET_CHANGED,
        SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
        SoftInputShowHideReason.IME_REQUESTED_CHANGED_LISTENER,
        SoftInputShowHideReason.HIDE_FOR_BUBBLES_WHEN_LOCKED,
})
public @interface SoftInputShowHideReason {
    /** Default, undefined reason. */
@@ -429,4 +430,7 @@ public @interface SoftInputShowHideReason {
     *  {@link com.android.server.wm.WindowManagerInternal.OnImeRequestedChangedListener}
     */
    int IME_REQUESTED_CHANGED_LISTENER = ImeProtoEnums.REASON_IME_REQUESTED_CHANGED_LISTENER;

    /** When locking the screen while the IME is showing, Bubbles requests the IME to hide. */
    int HIDE_FOR_BUBBLES_WHEN_LOCKED = ImeProtoEnums.REASON_HIDE_FOR_BUBBLES_WHEN_LOCKED;
}
+4 −4
Original line number Diff line number Diff line
@@ -229,10 +229,10 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
        PerDisplay pd = mImePerDisplay.get(displayId);
        InsetsSourceControl imeSourceControl = pd.getImeSourceControl();
        if (imeSourceControl != null) {
            ImeTracker.Token imeStatsToken = imeSourceControl.getImeStatsToken();
            if (imeStatsToken != null) {
                pd.setImeInputTargetRequestedVisibility(false, imeStatsToken);
            }
            final var statsToken = ImeTracker.forLogging().onStart(ImeTracker.TYPE_HIDE,
                    ImeTracker.ORIGIN_WM_SHELL,
                    SoftInputShowHideReason.HIDE_FOR_BUBBLES_WHEN_LOCKED, false /* fromUser */);
            pd.setImeInputTargetRequestedVisibility(false, statsToken);
        }
    }