Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black screen when switching from smartphone app to Android Auto #2468

Open
schachi5000 opened this issue Aug 29, 2024 · 3 comments
Open

Black screen when switching from smartphone app to Android Auto #2468

schachi5000 opened this issue Aug 29, 2024 · 3 comments
Labels
bug 🪲 Something isn't working

Comments

@schachi5000
Copy link

schachi5000 commented Aug 29, 2024

Environment

  • Android OS version: 14
  • Devices affected: Samsung
  • Tested Device: Samsung Galaxy S23 FE
  • Maps SDK Version: 10.13.0 & 11.6.0

Observed behavior and steps to reproduce

In our app we always close (finish) the smartphone app, once the Android Auto app has been launched by the user - to reduce load and keep the focus of the user on the head unit.

Exclusively on Samsung devices running Android 14 we've noticed, that the map surface in the head unit always turns black after a while, if the app was first launched on the smartphone.

At first the map screen is fully rendered, but after returning from another screen (i.e. Search) the map surface stays black. Only thing the user can now do in that situation is to close the app completely and directly start it manually via the head unit.

The following error log is constantly repeating while the screen is black.

[maps-android\Mbgl-RenderThread]: renderThreadPrepared=false but Android surface is valid, trying to recreate EGL...
[maps-android\Mbgl-RenderThread]: Setting up render thread, flags: creatingSurface=true, nativeRenderCreated=true, eglContextMadeCurrent=false, eglContextCreated=true, paused=false
[maps-android\Mbgl-EglCore]: eglCreateWindowSurface: EGL error: 0x300b
[maps-android\Mbgl-EglCore]: EGL error 12299 occurred for eglCreateWindowSurface!
[maps-android\Mbgl-RenderThread]: Could not create EGL surface although Android surface was valid, retrying in 50 ms...
[maps-android\Mbgl-RenderThread]: Setting up render thread failed, check logs above.
[maps-android\Mbgl-RenderThread]: renderThreadPrepared=false but Android surface is valid, trying to recreate EGL...
[maps-android\Mbgl-RenderThread]: Setting up render thread, flags: creatingSurface=true, nativeRenderCreated=true, eglContextMadeCurrent=false, eglContextCreated=true, paused=false

I was able to easily reproduce the behavior in your Android Auto example app, by adding some slight modifications.

  1. Added a MapView to the Activity
  2. When the CarSession is created the Activity is being finished (quick and dirty approach)
class MainActivity : AppCompatActivity() {
  companion object {
    var instance: MainActivity? = null
  }

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    instance = this
  }
}

class MapSession : Session() {
  private val carMapShowcase = CarMapShowcase()
  override fun onCreateScreen(intent: Intent): Screen {
    MainActivity.instance?.finish()

Expected behavior

The map screen should not turn black after returning to the map screen.

Additional links and references

error_example.mov
@schachi5000 schachi5000 added the bug 🪲 Something isn't working label Aug 29, 2024
@schachi5000
Copy link
Author

This issue still seems to be ongoing. Same behavior with the newest Mapbox version 11.7.1

@kiryldz
Copy link
Contributor

kiryldz commented Oct 24, 2024

@schachi5000 I am concerned that this issue seems to be very device specific: Samsung devices running Android 14. This somehow reminds me of flutter/flutter#146499. Did you try to look for similar issues on Samsung forums? Can you also confirm that this issue happens on the latest Samsung One UI? We are not quite busy with other staff and sadly could not invest much resources in investigating this one so maximum information will be appreciated.

@schachi5000
Copy link
Author

@kiryldz I've only found this Issue from earlier this year. But it seems it didn't lead anywhere.

Can you also confirm that this issue happens on the latest Samsung One UI

My Samsung test device is running on One UI 6.1. That's the one where I can reliable reproduce the issue.
On a Z Flip4 with One UI 5.1.1 everything works as intended.

I will try to get my hands on the One UI 7 Beta to see if the issue persists - but since there are a lot of Samsung users out there running Android 14, this would hardly be a viable solution for them :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants