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

Commit 21a0c220 authored by Roy Chou's avatar Roy Chou Committed by Android (Google) Code Review
Browse files

Merge "chore(accessibility): adjust TestableWindowManager#getCurrentWindowMetrics" into main

parents 90077d03 c60ac38f
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -85,10 +85,15 @@ public class TestableWindowManager implements WindowManager {
    @Override
    public WindowMetrics getCurrentWindowMetrics() {
        final WindowMetrics realMetrics = mWindowManager.getCurrentWindowMetrics();
        final Rect windowBounds = mWindowBounds == null
                ? realMetrics.getBounds()
                : mWindowBounds;
        final WindowInsets windowInsets = mWindowInsets == null
                ? realMetrics.getWindowInsets()
                : mWindowInsets;
        final WindowMetrics windowMetrics = new WindowMetrics(
                mWindowBounds == null ? realMetrics.getBounds()
                        : mWindowBounds,
                mWindowInsets == null ?  realMetrics.getWindowInsets() : mWindowInsets);
                new Rect(windowBounds),
                new WindowInsets(windowInsets));
        return windowMetrics;
    }