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
// 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;
}