Skip to content

Commit

Permalink
Fix failing Ultra HDR sample on emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
yrezgui committed Sep 4, 2024
1 parent f6714a6 commit d929644
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ class UltraHDRWithOpenGL : Fragment(),
}

override fun onAttach(context: Context) {
requireActivity().display
?.registerHdrSdrRatioChangedListener(Runnable::run, updateHdrSdrRatio)
requireActivity().display?.let { display ->
if (display.isHdrSdrRatioAvailable) {
display.registerHdrSdrRatioChangedListener(Runnable::run, updateHdrSdrRatio)
}
}
super.onAttach(context)
}

Expand Down

0 comments on commit d929644

Please sign in to comment.