• Birdson Chen's avatar
    Skip albumart when the size of image file bigger than maximal heap size. · 2c3a3d48
    Birdson Chen authored
    When the audio doesn't contain embedded art, MediaProvider
    will help to look for a suitable image file in the same
    directory as the media file, excpet if that directory is
    the root directory of the sd card or download directory.
    
    MediaProvider looks for, in order of preference:
     1 AlbumArt.jpg
     2 AlbumArt*Large.jpg
     3 Any other jpg image with 'albumart' anywhere in the name
     4 Any other jpg image
     5 any other png image
    
    If we put a image file and a audio file in same directory of
    sdcard, and the size of a image should large than maximal heap size.
    It will cause hte process android.process.media stop because OOM.
    As a result, we need catch OutOfMemoryError exception to avoid this issue.
    
    Change-Id: I4131188b4b75454f5bdb20c50b930ff8b7a370fa
    
    Change-Id: I4131188b4b75454f5bdb20c50b930ff8b7a370fa
    2c3a3d48
MediaProvider.java 244 KB