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

Commit 96b906f5 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Don't log bad surface size before layout is done.

The surface dimensions are calculated when the surface is created.
This might happen before the window had a chance to relayout itself,
so the dimensions passed to the surface will be wrong. This doesn't
happen on subsequent recreations of the surface, because the window
has previous dimensions, but will produce a bad log when the surface
is first created.

Bug: 26061934
Change-Id: I670bbb6d64f5ec7efabe3bd838a116a1d48e74f2
parent ee15241a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -710,11 +710,13 @@ class WindowStateAnimator {

        // Something is wrong and SurfaceFlinger will not like this, try to revert to sane values.
        if (mTmpSize.width() < 1) {
            Slog.w(TAG, "Width of " + w + " is not positive " + mTmpSize.width());
            if (!mWin.mLayoutNeeded) Slog.w(TAG,
                    "Width of " + w + " is not positive " + mTmpSize.width());
            mTmpSize.right = mTmpSize.left + 1;
        }
        if (mTmpSize.height() < 1) {
            Slog.w(TAG, "Height of " + w + " is not positive " + mTmpSize.height());
            if (!mWin.mLayoutNeeded) Slog.w(TAG,
                    "Height of " + w + " is not positive " + mTmpSize.height());
            mTmpSize.bottom = mTmpSize.top + 1;
        }