Skip to content
Snippets Groups Projects
Commit de3073c6 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix crash when the device has no brightness mode setting

parent 15f6f282
No related branches found
No related tags found
1 merge request!93Fix crash when the device has no brightness mode setting
Pipeline #6673 passed with stage
in 4 minutes and 18 seconds
......@@ -297,7 +297,7 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
else {
//Check if the device is in auto mode
val contentResolver = player.applicationContext.contentResolver
if (Settings.System.getInt(contentResolver, Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
if (Settings.System.getInt(contentResolver, Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
//cannot retrieve a value -> 0.5
0.5f
} else Settings.System.getInt(contentResolver, Settings.System.SCREEN_BRIGHTNESS, 128).toFloat() / 255
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment