[Android] Remove sound lowering on notification

Geoffrey Métais git at videolan.org
Mon Nov 7 16:07:13 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov  7 16:03:10 2016 +0100| [65176b52d7c1efb2a634f487b319a9f7f00bff3c] | committer: Geoffrey Métais

Remove sound lowering on notification

It just did not work, event arrives too late

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 11f5ea9..d572c7e 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -330,7 +330,6 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
     private OnAudioFocusChangeListener createOnAudioFocusChangeListener() {
         return new OnAudioFocusChangeListener() {
             private boolean mLossTransient = false;
-            private int mLossTransientVolume = -1;
             private boolean wasPlaying = false;
 
             @Override
@@ -353,21 +352,9 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
                         if (wasPlaying)
                             pause();
                         break;
-                    case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
-                        Log.i(TAG, "AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK");
-                        // Lower the volume
-                        if (mMediaPlayer.isPlaying()) {
-                            mLossTransientVolume = mMediaPlayer.getVolume();
-                            mMediaPlayer.setVolume(36);
-                        }
-                        break;
                     case AudioManager.AUDIOFOCUS_GAIN:
-                        Log.i(TAG, "AUDIOFOCUS_GAIN: " + mLossTransientVolume + ", " + mLossTransient);
+                        Log.i(TAG, "AUDIOFOCUS_GAIN: ");
                         // Resume playback
-                        if (mLossTransientVolume != -1) {
-                            mMediaPlayer.setVolume(mLossTransientVolume);
-                            mLossTransientVolume = -1;
-                        }
                         if (mLossTransient) {
                             if (wasPlaying)
                                 mMediaPlayer.play();



More information about the Android mailing list