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

Commit 7928f7cd authored by Tarandeep Singh's avatar Tarandeep Singh
Browse files

Register Ime consumer only when insets are enabled.

As of today we register Ime consumer in IMM onWindowGainedFocus().
However, it does nothing functionally when ViewRootImpl#sNewInsetsMode is disabled.
This CL adds a check to not register consumer at the first place.

This may also be causing a leak. Added a TODO to revisit that before we
enable the flag.

Bug: 131181940
Test: atest ViewRootImpl
Test: atest InsetsController
Change-Id: I6b2b62d10670d63edafeb1b24c25b26c7721f3ad
parent a37cd55e
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -2814,11 +2814,15 @@ public final class ViewRootImpl implements ViewParent,
            hasWindowFocus = mUpcomingWindowFocus;
            inTouchMode = mUpcomingInTouchMode;
        }
        if (sNewInsetsMode != NEW_INSETS_MODE_NONE) {
            // TODO (b/131181940): Make sure this doesn't leak Activity with mActivityConfigCallback
            // config changes.
            if (hasWindowFocus) {
                mInsetsController.onWindowFocusGained();
            } else {
                mInsetsController.onWindowFocusLost();
            }
        }

        if (mAdded) {
            profileRendering(hasWindowFocus);