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

Nicolas Pomepuy git at videolan.org
Thu May 2 15:15:48 CEST 2019


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

Fix crash when the device has no brightness mode setting

(cherry picked from commit de3073c66b285bff39d24d62638e855418d2cf5e)

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

 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 32c32291f..09168fbb0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -293,7 +293,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