shadows/framework/src/main/java/org/robolectric/shadows/ShadowAudioManager.java
@TargetApi(VERSION_CODES.O)
  public void setActivePlaybackConfigurationsFor(List<AudioAttributes> audioAttributes) {
    activePlaybackConfigurations = new ArrayList<>(audioAttributes.size());
    for (AudioAttributes audioAttribute : audioAttributes) {
      Parcel p = Parcel.obtain();
      p.writeInt(0); // mPlayerIId
      p.writeInt(0); // mPlayerType
      p.writeInt(0); // mClientUid
      p.writeInt(0); // mClientPid
      p.writeInt(AudioPlaybackConfiguration.PLAYER_STATE_STARTED); // mPlayerState
      audioAttribute.writeToParcel(p, 0);
      p.writeStrongInterface(null);
      byte[] bytes = p.marshall();
      p.recycle();
      p = Parcel.obtain();
      p.unmarshall(bytes, 0, bytes.length);
      p.setDataPosition(0);
      AudioPlaybackConfiguration configuration =
          AudioPlaybackConfiguration.CREATOR.createFromParcel(p);
      p.recycle();
      activePlaybackConfigurations.add(configuration);
    }
  }
@TargetApi(VERSION_CODES.O)
  public void setActivePlaybackConfigurationsFor(List<AudioAttributes> audioAttributes) {
    activePlaybackConfigurations = new ArrayList<>(audioAttributes.size());
    for (AudioAttributes audioAttribute : audioAttributes) {
      Parcel p = Parcel.obtain();
      p.writeInt(0); // mPlayerIId
      p.writeInt(0); // mPlayerType
      p.writeInt(0); // mClientUid
      p.writeInt(0); // mClientPid
      p.writeInt(AudioPlaybackConfiguration.PLAYER_STATE_STARTED); // mPlayerState
      audioAttribute.writeToParcel(p, 0);
      p.writeStrongInterface(null);
      byte[] bytes = p.marshall();
      p.recycle();
      p = Parcel.obtain();
      p.unmarshall(bytes, 0, bytes.length);
      p.setDataPosition(0);
      AudioPlaybackConfiguration configuration =
          AudioPlaybackConfiguration.CREATOR.createFromParcel(p);
      p.recycle();
      activePlaybackConfigurations.add(configuration);
    }
  }
@ TargetApi ( VERSION_CODES . O ) public void setActivePlaybackConfigurationsFor ( List < AudioAttributes > audioAttributes ) { activePlaybackConfigurations = new ArrayList <> ( audioAttributes . size ( ) ) ; for ( AudioAttributes audioAttribute : audioAttributes ) { Parcel p = Parcel . obtain ( ) ; p . writeInt ( 0 ) ; // mPlayerIId p . writeInt ( 0 ) ; // mPlayerType p . writeInt ( 0 ) ; // mClientUid p . writeInt ( 0 ) ; // mClientPid p . writeInt ( AudioPlaybackConfiguration . PLAYER_STATE_STARTED ) ; // mPlayerState audioAttribute . writeToParcel ( p , 0 ) ; p . writeStrongInterface ( null ) ; byte [ ] bytes = p . marshall ( ) ; p . recycle ( ) ; p = Parcel . obtain ( ) ; p . unmarshall ( bytes , 0 , bytes . length ) ; p . setDataPosition ( 0 ) ; AudioPlaybackConfiguration configuration = AudioPlaybackConfiguration . CREATOR . createFromParcel ( p ) ; p . recycle ( ) ; activePlaybackConfigurations . add ( configuration ) ; } }
Sets active playback configurations that will be served by {@link
AudioManager#getActivePlaybackConfigurations}.

<p>Note that there is no public {@link AudioPlaybackConfiguration} constructor, so the
configurations returned are specified by their audio attributes only.
Sets active playback configurations that will be served by { @link AudioManager#getActivePlaybackConfigurations } .