[Android] Do not set notification style for crappy devices

Geoffrey Métais git at videolan.org
Tue Jun 28 16:00:45 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jun 28 15:59:58 2016 +0200| [159f9d667e10e5944a017acc5b02cd47c6b9c7a5] | committer: Geoffrey Métais

Do not set notification style for crappy devices

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

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

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index c3c7bed..26f19f5 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -898,12 +898,14 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
                 builder.addAction(R.drawable.ic_play_w, getString(R.string.play), piPlay);
             builder.addAction(R.drawable.ic_next_w, getString(R.string.next), piForward);
 
-            builder.setStyle(new NotificationCompat.MediaStyle()
-                            .setMediaSession(mMediaSession.getSessionToken())
-                            .setShowActionsInCompactView(new int[] {0,1,2})
-                            .setShowCancelButton(true)
-                            .setCancelButtonIntent(piStop)
-            );
+            if (AndroidDevices.showMediaStyle) {
+                builder.setStyle(new NotificationCompat.MediaStyle()
+                                .setMediaSession(mMediaSession.getSessionToken())
+                                .setShowActionsInCompactView(new int[] {0,1,2})
+                                .setShowCancelButton(true)
+                                .setCancelButtonIntent(piStop)
+                );
+            }
 
             notification = builder.build();
 



More information about the Android mailing list