public void serializeDownloadQueue() {
    State state = new State();
    for (DownloadFile downloadFile : downloadService.getDownloads()) {
      state.songs.add(downloadFile.getSong());
    }
    state.currentPlayingIndex = downloadService.getCurrentPlayingIndex();
    state.currentPlayingPosition = downloadService.getPlayerPosition();

    Log.i(
        TAG,
        "Serialized currentPlayingIndex: "
            + state.currentPlayingIndex
            + ", currentPlayingPosition: "
            + state.currentPlayingPosition);
    FileUtil.serialize(downloadService, state, FILENAME_DOWNLOADS_SER);
  }
  private void deserializeDownloadQueue() {
    State state = FileUtil.deserialize(downloadService, FILENAME_DOWNLOADS_SER);
    if (state == null) {
      return;
    }
    Log.i(
        TAG,
        "Deserialized currentPlayingIndex: "
            + state.currentPlayingIndex
            + ", currentPlayingPosition: "
            + state.currentPlayingPosition);
    downloadService.restore(state.songs, state.currentPlayingIndex, state.currentPlayingPosition);

    // Work-around: Serialize again, as the restore() method creates a serialization without current
    // playing info.
    serializeDownloadQueue();
  }