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

Commit b0ef9a5e authored by Taran Singh's avatar Taran Singh Committed by Automerger Merge Worker
Browse files

Merge "Don't cache IME surface in fullscreen mode" into sc-dev am: e81d43c1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14665440

Change-Id: Ie58251a24e7a6334d2d583783d6df4198c4aea97
parents 82fb9288 e81d43c1
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -481,6 +481,7 @@ public class InputMethodService extends AbstractInputMethodService {

    boolean mFullscreenApplied;
    boolean mIsFullscreen;
    private boolean mLastWasInFullscreenMode;
    @UnsupportedAppUsage
    View mExtractView;
    boolean mExtractViewHidden;
@@ -920,9 +921,18 @@ public class InputMethodService extends AbstractInputMethodService {
        if (mHandler == null) {
            mHandler = new Handler(getMainLooper());
        }

        if (mLastWasInFullscreenMode) {
            // Caching surface / delaying surface removal can cause mServedView to detach in certain
            // cases in RecyclerView (b/187772544).
            // TODO(b/188818557): Re-enable IME surface caching for fullscreen mode once detaching
            //  view issues is resolved in RecyclerView.
            removeImeSurface();
        } else {
            mImeSurfaceScheduledForRemoval = true;
            mHandler.postDelayed(() -> removeImeSurface(), TIMEOUT_SURFACE_REMOVAL_MILLIS);
        }
    }

    private void removeImeSurface() {
        // hiding a window removes its surface.
@@ -2350,6 +2360,7 @@ public class InputMethodService extends AbstractInputMethodService {
            onWindowHidden();
            mDecorViewWasVisible = false;
        }
        mLastWasInFullscreenMode = mIsFullscreen;
        updateFullscreenMode();
    }