[Android] disable covers in audioBrowser if external storage is not available

Sébastien Toque git at videolan.org
Sun Oct 14 18:39:34 CEST 2012


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sun Oct 14 17:41:52 2012 +0200| [45af91a38f09d52e75b10b49d50b72e3f7c9fe0c] | committer: Sébastien Toque

disable covers in audioBrowser if external storage is not available

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
index ed8ff1c..c9c2d52 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
@@ -162,10 +162,15 @@ public class AudioUtil {
         return null;
     }
 
+    @SuppressLint("NewApi")
     public synchronized static Bitmap getCover(Context context, Media media, int width) {
         Bitmap cover = null;
         String cachePath = null;
 
+        // if external storage is not available, skip covers to prevent slow audio browsing
+        if (!Util.hasExternalStorage() && width > 0)
+            return null;
+
         try {
             // try to load from cache
             int hash = MurmurHash.hash32(media.getArtist()+media.getAlbum());



More information about the Android mailing list