Fixed two FCs. (1. bitmap recycled 2. ArrayList OOB)
This commit is contained in:
parent
bccf4fae5c
commit
fe3657707b
4 changed files with 16 additions and 10 deletions
|
|
@ -69,7 +69,8 @@ public class MusicPlayerWidget extends AppWidgetProvider {
|
|||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
||||
if (currentAlbumArtUri.equals(imageUri))
|
||||
setAlbumArt(context, loadedImage);
|
||||
// copy() prevents the original bitmap in the memory cache from being recycled by the remote views
|
||||
setAlbumArt(context, loadedImage.copy(loadedImage.getConfig(), true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -167,7 +167,8 @@ public class PlayingNotificationHelper {
|
|||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
||||
if (currentAlbumArtUri.equals(imageUri))
|
||||
setAlbumArt(loadedImage);
|
||||
// copy() prevents the original bitmap in the memory cache from being recycled by the remote views
|
||||
setAlbumArt(loadedImage.copy(loadedImage.getConfig(), true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -372,7 +372,8 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
|||
@Override
|
||||
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
|
||||
if (currentAlbumArtUri.equals(imageUri))
|
||||
updateRemoteControlClientBitmap(loadedImage);
|
||||
// copy() prevents the original bitmap in the memory cache from being recycled by the remote control client
|
||||
updateRemoteControlClientBitmap(loadedImage.copy(loadedImage.getConfig(), true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -793,12 +794,15 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
|||
|
||||
private void notifyChange(final String what) {
|
||||
//to let other apps know whats playing. i.E. last.fm (scrobbling) or musixmatch
|
||||
final Song currentSong = playingQueue.get(getPosition());
|
||||
final Intent intent = new Intent(what);
|
||||
intent.putExtra("id", currentSong.id);
|
||||
intent.putExtra("artist", currentSong.artistName);
|
||||
intent.putExtra("album", currentSong.albumName);
|
||||
intent.putExtra("track", currentSong.title);
|
||||
final int position = getPosition();
|
||||
if(position >= 0) {
|
||||
final Song currentSong = playingQueue.get(position);
|
||||
intent.putExtra("id", currentSong.id);
|
||||
intent.putExtra("artist", currentSong.artistName);
|
||||
intent.putExtra("album", currentSong.albumName);
|
||||
intent.putExtra("track", currentSong.title);
|
||||
}
|
||||
intent.putExtra("playing", isPlaying());
|
||||
sendStickyBroadcast(intent);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue