Log error when exceeding MAX_LAYERS count
This is not a fix, but logging to make it clearer
what's happening.
Test: for i in {1..1000}; do cts-tradefed run commandAndExit cts-dev \
--abi armeabi-v7a --no-primary-abi-only --module \
CtsOpenGLTestCases -t android.opengl.cts.EglConfigTest#testEglConfigs ; \
done
May take a while to run.
The log message below indicates an issue, most likely leaking layers.
Once b/3712178 is resolved, should not see this error.
AddClientLayer failed, mNumLayers (4096) >= MAX_LAYERS (4096)
Bug: 37121786
Also related to Bug: 30948621
Change-Id: I7ed931ae5433657bdc986edc66a9782ff08ed194
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index bc51d5f..71d5cab 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2637,6 +2637,8 @@
{
Mutex::Autolock _l(mStateLock);
if (mNumLayers >= MAX_LAYERS) {
+ ALOGE("AddClientLayer failed, mNumLayers (%zu) >= MAX_LAYERS (%zu)", mNumLayers,
+ MAX_LAYERS);
return NO_MEMORY;
}
if (parent == nullptr) {