Skip to content

Commit 38e2a42

Browse files
pengdevgithub-actions[bot]
authored andcommitted
[maps-sdk] Fix EGL surface create retry spam on Android Auto (#15678)
GitOrigin-RevId: e72dda34237f3e46d61870c447181f3d7b29a174
1 parent a7c9bf1 commit 38e2a42

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Mapbox welcomes participation and contributions from everyone.
1616

1717
## Bug fixes 🐞
1818
* Fix a `NullPointerException` crash in location puck animators when `AnimationThreadController.useBackgroundThread()` is enabled.
19+
* Fix logcat spam from repeated EGL surface create failures when an Android Auto `BufferQueue` is abandoned. `GLMapboxRenderThread` now throttles the retry warning log.
1920

2021
# 11.28.0
2122
## Bug fixes 🐞
@@ -40,7 +41,6 @@ Mapbox welcomes participation and contributions from everyone.
4041
## Dependencies
4142
* Update gl-native to [v11.28.0-rc.1](https://github.com/mapbox/mapbox-maps-android/releases/tag/v11.28.0-rc.1), common to [v24.28.0-rc.1](https://github.com/mapbox/mapbox-maps-android/releases/tag/v11.28.0-rc.1).
4243

43-
4444
# 11.27.0 July 24, 2026
4545
## Features ✨ and improvements 🏁
4646
* Add cross-source HD road elevation for symbols, so road symbols can align to HD elevation data provided by a separate source.

‎maps-sdk/src/main/java/com/mapbox/maps/renderer/GLMapboxRenderThread.kt‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.opengl.EGLSurface
66
import android.opengl.GLES20
77
import android.view.Surface
88
import androidx.annotation.VisibleForTesting
9+
import com.mapbox.common.LogThrottler
910
import com.mapbox.maps.ContextMode
1011
import com.mapbox.maps.logI
1112
import com.mapbox.maps.logW
@@ -31,6 +32,8 @@ internal class GLMapboxRenderThread : MapboxRenderThread {
3132

3233
private var eglContextCreated = false
3334

35+
private val eglSurfaceCreateLogThrottler = LogThrottler(EGL_SURFACE_CREATE_LOG_THROTTLE_INTERVAL_MS)
36+
3437
constructor(
3538
mapboxRenderer: MapboxRenderer,
3639
mapboxWidgetRenderer: MapboxWidgetRenderer,
@@ -114,7 +117,8 @@ internal class GLMapboxRenderThread : MapboxRenderThread {
114117
logW(
115118
TAG,
116119
"Could not create EGL surface although Android surface was valid," +
117-
" retrying in $RETRY_DELAY_MS ms..."
120+
" retrying in $RETRY_DELAY_MS ms...",
121+
eglSurfaceCreateLogThrottler
118122
)
119123
postPrepareRenderFrame(delayMillis = RETRY_DELAY_MS)
120124
return false
@@ -256,4 +260,8 @@ internal class GLMapboxRenderThread : MapboxRenderThread {
256260
widgetRenderer?.release()
257261
}
258262
}
263+
264+
private companion object {
265+
private const val EGL_SURFACE_CREATE_LOG_THROTTLE_INTERVAL_MS = 5_000L
266+
}
259267
}

0 commit comments

Comments
 (0)