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

Commit 72b16dfe authored by Felix Stern's avatar Felix Stern
Browse files

Not relying on statsToken when Bubbles hides IME during screen lock

Bug: 396884941
Test: None logs only
Flag: EXEMPT logs only
Change-Id: I28a842a4c3a17183591a1fc68340c6d4bcda4e66
parent f6a4d285
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -307,6 +307,8 @@ public final class InputMethodDebug {
                return "HIDE_WINDOW_LOST_FOCUS";
                return "HIDE_WINDOW_LOST_FOCUS";
            case SoftInputShowHideReason.IME_REQUESTED_CHANGED_LISTENER:
            case SoftInputShowHideReason.IME_REQUESTED_CHANGED_LISTENER:
                return "IME_REQUESTED_CHANGED_LISTENER";
                return "IME_REQUESTED_CHANGED_LISTENER";
            case SoftInputShowHideReason.HIDE_FOR_BUBBLES_WHEN_LOCKED:
                return "HIDE_FOR_BUBBLES_WHEN_LOCKED";
            default:
            default:
                return "Unknown=" + reason;
                return "Unknown=" + reason;
        }
        }
+4 −0
Original line number Original line Diff line number Diff line
@@ -93,6 +93,7 @@ import java.lang.annotation.Retention;
        SoftInputShowHideReason.HIDE_INPUT_TARGET_CHANGED,
        SoftInputShowHideReason.HIDE_INPUT_TARGET_CHANGED,
        SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
        SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
        SoftInputShowHideReason.IME_REQUESTED_CHANGED_LISTENER,
        SoftInputShowHideReason.IME_REQUESTED_CHANGED_LISTENER,
        SoftInputShowHideReason.HIDE_FOR_BUBBLES_WHEN_LOCKED,
})
})
public @interface SoftInputShowHideReason {
public @interface SoftInputShowHideReason {
    /** Default, undefined reason. */
    /** Default, undefined reason. */
@@ -429,4 +430,7 @@ public @interface SoftInputShowHideReason {
     *  {@link com.android.server.wm.WindowManagerInternal.OnImeRequestedChangedListener}
     *  {@link com.android.server.wm.WindowManagerInternal.OnImeRequestedChangedListener}
     */
     */
    int IME_REQUESTED_CHANGED_LISTENER = ImeProtoEnums.REASON_IME_REQUESTED_CHANGED_LISTENER;
    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 Original line Diff line number Diff line
@@ -229,10 +229,10 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
        PerDisplay pd = mImePerDisplay.get(displayId);
        PerDisplay pd = mImePerDisplay.get(displayId);
        InsetsSourceControl imeSourceControl = pd.getImeSourceControl();
        InsetsSourceControl imeSourceControl = pd.getImeSourceControl();
        if (imeSourceControl != null) {
        if (imeSourceControl != null) {
            ImeTracker.Token imeStatsToken = imeSourceControl.getImeStatsToken();
            final var statsToken = ImeTracker.forLogging().onStart(ImeTracker.TYPE_HIDE,
            if (imeStatsToken != null) {
                    ImeTracker.ORIGIN_WM_SHELL,
                pd.setImeInputTargetRequestedVisibility(false, imeStatsToken);
                    SoftInputShowHideReason.HIDE_FOR_BUBBLES_WHEN_LOCKED, false /* fromUser */);
            }
            pd.setImeInputTargetRequestedVisibility(false, statsToken);
        }
        }
    }
    }