Improve logging when crashing due to locked screen.

When screen is locked we see this message in logcat:

    02-07 10:13:42.663  1623  4713 V SplashScreenExceptionList: SplashScreen checking exception for package com.android.angle.test (target sdk:33) -> false

followed by ANGLE crash due to nullptr.

Bug: chromium:1405504
Change-Id: Ib3c00cae160e950f8207c9cc0297c92c8b8afe98
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4227987
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Auto-Submit: Roman Lavrov <romanl@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
This commit is contained in:
Roman Lavrov
2023-02-07 10:18:25 -05:00
committed by Angle LUCI CQ
parent 3886af6e44
commit 1857345f92

View File

@@ -120,6 +120,12 @@ bool AndroidWindow::resize(int width, int height)
}
pthread_mutex_unlock(&sInitWindowMutex);
if (sApp->window == nullptr)
{
// Note: logging isn't initalized yet but this message shows up in logcat.
FATAL() << "Window is NULL (is screen locked? e.g. SplashScreen in logcat)";
}
// TODO: figure out a way to set the format as well,
// which is available only after EGLWindow initialization
int32_t err = ANativeWindow_setBuffersGeometry(sApp->window, mWidth, mHeight, 0);