[Android] Do not set notification style for crappy devices

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


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

Do not set notification style for crappy devices

(cherry picked from commit 159f9d667e10e5944a017acc5b02cd47c6b9c7a5)

> https://code.videolan.org/videolan/vlc-android/commit/6c1ffb62ab7739ee88a77eb859c9650a6fa0a96c
---

 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 5993a90..197c116 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -907,12 +907,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