[Android] Hide ducking option on Oreo devices

Geoffrey Métais git at videolan.org
Tue Jan 23 16:33:05 CET 2018


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 22 11:03:20 2018 +0100| [4cdbe110cb25918d64c53be95309a4c1cd58718e] | committer: Geoffrey Métais

Hide ducking option on Oreo devices

Oreo auto-ducks, this is no effective

(cherry picked from commit 2123ea14aaef9ef53ad6a0158f054e9e3f8d470e)

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

 vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.java  | 2 ++
 .../src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java       | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.java
index b4450ecc2..c2dc86204 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.java
@@ -27,6 +27,7 @@ import android.os.Bundle;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.TwoStatePreference;
 
+import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.libvlc.util.HWDecoderUtil;
 import org.videolan.vlc.PlaybackService;
 import org.videolan.vlc.R;
@@ -53,6 +54,7 @@ public class PreferencesAudio extends BasePreferenceFragment implements SharedPr
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        findPreference("audio_ducking").setVisible(!AndroidUtil.isOOrLater);
         final HWDecoderUtil.AudioOutput aout = HWDecoderUtil.getAudioOutputFromDevice();
         if (aout != HWDecoderUtil.AudioOutput.ALL) {
             /* no AudioOutput choice */
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java
index 327136027..f7377e87c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java
@@ -26,6 +26,7 @@ import android.content.SharedPreferences;
 import android.os.Build;
 import android.os.Bundle;
 
+import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.libvlc.util.HWDecoderUtil;
 import org.videolan.vlc.R;
 import org.videolan.vlc.util.VLCInstance;
@@ -52,6 +53,7 @@ public class PreferencesAudio extends BasePreferenceFragment implements SharedPr
         findPreference("enable_steal_remote_control").setVisible(false);
         findPreference("headset_prefs_category").setVisible(false);
         findPreference("lockscreen_cover").setVisible(false);
+        findPreference("audio_ducking").setVisible(!AndroidUtil.isOOrLater);
 
         final HWDecoderUtil.AudioOutput aout = HWDecoderUtil.getAudioOutputFromDevice();
         if (aout != HWDecoderUtil.AudioOutput.ALL) {



More information about the Android mailing list