[Android] Restore permission asking for brightness change
Geoffrey Métais
git at videolan.org
Fri Feb 24 18:28:49 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 24 18:25:43 2017 +0100| [a2838e3f02e8576f9c77d637197eb4549a9869f9] | committer: Geoffrey Métais
Restore permission asking for brightness change
This reverts commit fad767ac9f454ab14202c30fe2a6f49279efa504.
> https://code.videolan.org/videolan/vlc-android/commit/a2838e3f02e8576f9c77d637197eb4549a9869f9
---
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 19067bb..68103ec 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2197,6 +2197,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
// Initialize the layoutParams screen brightness
try {
if (Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
+ if (!Permissions.canWriteSettings(this)) {
+ Permissions.checkWriteSettingsPermission(this, Permissions.PERMISSION_SYSTEM_BRIGHTNESS);
+ return;
+ }
Settings.System.putInt(getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
More information about the Android
mailing list