[Android] Fix crash when the device has no brightness mode setting

Nicolas Pomepuy git at videolan.org
Thu May 2 13:46:24 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu May  2 07:33:09 2019 +0200| [de3073c66b285bff39d24d62638e855418d2cf5e] | committer: Geoffrey Métais

Fix crash when the device has no brightness mode setting

> https://code.videolan.org/videolan/vlc-android/commit/de3073c66b285bff39d24d62638e855418d2cf5e
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
index 9271f09a6..f32fe8c08 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -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



More information about the Android mailing list