[Android] Audio : Set correct notification default cover

Alexandre Perraud git at videolan.org
Fri Oct 30 17:54:24 CET 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Oct 30 17:39:35 2015 +0100| [5b6888f7d966431d64306b98a9e2b30367e59d24] | committer: Alexandre Perraud

Audio : Set correct notification default cover

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=5b6888f7d966431d64306b98a9e2b30367e59d24
---

 vlc-android/AndroidManifest.xml                       |    2 +-
 vlc-android/src/org/videolan/vlc/PlaybackService.java |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml
index b10c00e..39e482a 100644
--- a/vlc-android/AndroidManifest.xml
+++ b/vlc-android/AndroidManifest.xml
@@ -48,7 +48,7 @@
         android:largeHeap="true"
         android:icon="@drawable/icon"
         android:label="@string/app_name"
-        android:logo="@drawable/ic_logo_w"
+        android:logo="@drawable/icon"
         android:theme="@style/Theme.VLC.NoTitleBar" >
         <activity
             android:name=".gui.MainActivity"
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index b17d86a..e54d56a 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -33,6 +33,7 @@ import android.content.ServiceConnection;
 import android.content.SharedPreferences;
 import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
 import android.media.AudioManager;
 import android.media.AudioManager.OnAudioFocusChangeListener;
 import android.media.RemoteControlClient;
@@ -848,6 +849,8 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
             String artist = metaData.getString(MediaMetadataCompat.METADATA_KEY_ALBUM_ARTIST);
             String album = metaData.getString(MediaMetadataCompat.METADATA_KEY_ALBUM);
             Bitmap cover = metaData.getBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART);
+            if (cover == null)
+                cover = BitmapFactory.decodeResource(VLCApplication.getAppContext().getResources(), R.drawable.icon);
             Notification notification;
 
             //Watch notification dismissed



More information about the Android mailing list