title: MediaMetadataCompat METADATA_KEY_ART only sets image the first time
body: <p>In my application, I'm making use of <code>MediaSessionCompat</code> to handle playing audio from my media player service. Particularly, I want to broadcast the current song's metadata to bluetooth devices (which works), and set the lock screen image to the current song's album art.</p>
  
  <p>Similar to this question: <a href="https://stackoverflow.com/questions/22281616/set-lock-screen-background-in-android-like-spotify-do">Set lock screen background in Android (like Spotify do)</a></p>
  
  <p>Each time the song changes, I first clear off the current <code>MediaMetadataCompat</code> and <code>PlaybackStateCompat</code> from the <code>MediaSessionCompat</code> like so:</p>
  
  <pre><code>mSession.setActive(false);
  mSession.setMetadata(null);
  mSession.setPlaybackState(null);
  </code></pre>
  
  <p>Then, I create new instances of those classes with their respective builders</p>
  
  <pre><code>MediaMetadataCompat metadata = new MediaMetadataCompat.Builder()
          .putString(MediaMetadataCompat.METADATA_KEY_TITLE,
                                  songName)
          .putString(MediaMetadataCompat.METADATA_KEY_ARTIST,
                                  artistName)
          .putString(MediaMetadataCompat.METADATA_KEY_ALBUM,
                                  albumName)
          .putLong(MediaMetadataCompat.METADATA_KEY_DURATION, durationMs)
          .putBitmap(MediaMetadataCompat.METADATA_KEY_ART, bitmap)
          .build();
  
  PlaybackStateCompat state = new PlaybackStateCompat.Builder()
          .setActions(PlaybackStateCompat.ACTION_PLAY | PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PAUSE |
                                      PlaybackStateCompat.ACTION_SKIP_TO_NEXT | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS)
          .setState(PlaybackStateCompat.STATE_PLAYING, positionMs, 1.0f, SystemClock.elapsedRealtime())
          .build();
  </code></pre>
  
  <p>Then I set the new metadata on the <code>MediaSessionCompat</code></p>
  
  <pre><code>mSession.setActive(true);
  mSession.setMetadata(metadata);
  mSession.setPlaybackState(state);
  </code></pre>
  
  <p>On my bluetooth device, the Metadata works fine, and changes each time the song changes. On my phone however, the lock screen album cover updates only the first time. I've confirmed that the bitmap I'm setting is the new one, but the image does not change.</p>
  
  <p>I'm also creating a media style notification in the service to allow the user to control the music from a persistent notification and from their lock screen.</p>
  
  <pre><code>NotificationCompat.MediaStyle style = new NotificationCompat.MediaStyle();
  style.setShowActionsInCompactView(0, 1, 2, 3, 4);
  
  Intent intent = new Intent(this, DestinationActivity.class);
  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
  
  PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
  NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
              .setSmallIcon(R.drawable.ic_notification)
              .setContentIntent(pendingIntent)
              .setStyle(style)
              .setContentTitle(songName)
              .setContentText(artistName)
              .setLargeIcon(bitmap);
  
  // Code to set notification actions 
  
  startForeground(NOTIFICATION_ID_PLAYER_CONTROLS, builder.build());
  </code></pre>
  
  <p>However, the <code>setLargeIcon</code> method for my media notification does not have an effect on the album cover being displayed on the lock screen. This makes it show up in the notification itself, but not as the lock screen background.</p>