code: @SuppressWarnings("deprecation")
      public void setMetaData(SoundCloudTrack track, Bitmap artwork) {
          if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
  
              // set meta data on the lock screen for pre lollipop.
              mRemoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
              RemoteControlClientCompat.MetadataEditorCompat mediaEditorCompat
                      = mRemoteControlClientCompat.editMetadata(true)
                      .putString(MediaMetadataRetriever.METADATA_KEY_TITLE, track.getTitle())
                      .putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, track.getArtist());
              if (artwork != null) {
                  mediaEditorCompat.putBitmap(
                          RemoteControlClientCompat.MetadataEditorCompat.METADATA_KEY_ARTWORK, artwork);
              }
              mediaEditorCompat.apply();
          }
  
          // set meta data to the media session.
          MediaMetadataCompat.Builder metadataCompatBuilder = new MediaMetadataCompat.Builder()
                  .putString(MediaMetadataCompat.METADATA_KEY_TITLE, track.getTitle())
                  .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, track.getArtist());
          if (artwork != null) {
              metadataCompatBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, artwork);
          }
          mMediaSession.setMetadata(metadataCompatBuilder.build());
          setMediaSessionCompatPlaybackState(PlaybackStateCompat.STATE_PLAYING);
      }
docs: Update meta data used by the remote control client and the media session.
  
  @param track   track currently played.
  @param artwork track artwork.