[Android] VideoPlayer: catch exception on volume change
Geoffrey Métais
git at videolan.org
Mon Oct 29 09:25:56 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Oct 29 09:24:59 2018 +0100| [ec936750c30ebd6b75d91bf8e505bbea02ab8e67] | committer: Geoffrey Métais
VideoPlayer: catch exception on volume change
> https://code.videolan.org/videolan/vlc-android/commit/ec936750c30ebd6b75d91bf8e505bbea02ab8e67
---
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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 652130324..f711e17cc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -64,6 +64,8 @@ import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.ViewStubCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
+
+import android.os.RemoteException;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.DisplayMetrics;
@@ -1939,7 +1941,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
// High Volume warning can block volume setting
if (mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC) != vol)
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, vol, AudioManager.FLAG_SHOW_UI);
- } catch (SecurityException ignored) {} //Some device won't allow us to change volume
+ } catch (RuntimeException ignored) {} //Some device won't allow us to change volume
}
vol = Math.round(vol * 100 / mAudioMax);
} else {
More information about the Android
mailing list