Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4348edc9 authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "Addresses the API review feedback on HwAudioSource"

parents 57602f1c a1561e5e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3539,6 +3539,7 @@ package android.media {
  }
  public class HwAudioSource {
    method public boolean isPlaying();
    method public void start();
    method public void stop();
  }
+9 −0
Original line number Diff line number Diff line
@@ -129,12 +129,21 @@ public class HwAudioSource extends PlayerBase {
     * Starts the playback from {@link AudioDeviceInfo}.
     */
    public void start() {
        Preconditions.checkState(!isPlaying(), "HwAudioSource is currently playing");
        baseStart();
        mNativeHandle = AudioSystem.startAudioSource(
                mAudioDeviceInfo.getPort().activeConfig(),
                mAudioAttributes);
    }

    /**
     * Checks whether the HwAudioSource player is playing.
     * @return true if currently playing, false otherwise
     */
    public boolean isPlaying() {
        return mNativeHandle != 0;
    }

    /**
     * Stops the playback from {@link AudioDeviceInfo}.
     */