android / platform-samples

A collection of samples of different Android OS platform APIs.
https://developer.android.com/about
Apache License 2.0
1.13k stars 239 forks source link

[Bug]: Opening sample UltraHDR x OpenGLES SurfaceView crashes the app #187

Closed calren closed 1 month ago

calren commented 3 months ago

Is there an existing issue for this?

In which area is the issue?

General

In a specific sample?

UltraHDR x OpenGLES SurfaceView

What happened?

UltraHDR x OpenGLES SurfaceView sample can't be opened on Pixel 6a.

NavigationTest.testSamplesOpen caught this on a recent PR where I tried to get tests to run again: https://github.com/android/platform-samples/pull/185

Relevant logcat output

java.lang.IllegalStateException: HDR/SDR ratio changed not available
                                                                                                        at android.view.Display.registerHdrSdrRatioChangedListener(Display.java:1357)
                                                                                                        at com.example.platform.graphics.ultrahdr.opengl.UltraHDRWithOpenGL.onAttach(UltraHDRWithOpenGL.kt:186)
                                                                                                        at androidx.fragment.app.Fragment.performAttach(Fragment.java:3071)
                                                                                                        at androidx.fragment.app.FragmentStateManager.attach(FragmentStateManager.java:502)
                                                                                                        at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:271)
                                                                                                        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2102)
                                                                                                        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1997)
                                                                                                        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1940)
                                                                                                        at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:660)
                                                                                                        at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                        at android.os.Looper.loop(Looper.java:317)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8501)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Code of Conduct

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

yrezgui commented 1 month ago

194 Fixes this