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

Commit 3b084cfe authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Document AudioSystem::newAudioSessionId() failures"

parents 551cec54 85d109a4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -141,7 +141,13 @@ public:
    // return the number of input frames lost by HAL implementation, or 0 if the handle is invalid
    static uint32_t getInputFramesLost(audio_io_handle_t ioHandle);

    // Allocate a new audio session ID and return that new ID.
    // If unable to contact AudioFlinger, returns AUDIO_SESSION_ALLOCATE instead.
    // FIXME If AudioFlinger were to ever exhaust the session ID namespace,
    //       this method could fail by returning either AUDIO_SESSION_ALLOCATE
    //       or an unspecified existing session ID.
    static int newAudioSessionId();

    static void acquireAudioSessionId(int audioSession, pid_t pid);
    static void releaseAudioSessionId(int audioSession, pid_t pid);

+1 −1
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ uint32_t AudioSystem::getInputFramesLost(audio_io_handle_t ioHandle)
int AudioSystem::newAudioSessionId()
{
    const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
    if (af == 0) return 0;
    if (af == 0) return AUDIO_SESSION_ALLOCATE;
    return af->newAudioSessionId();
}

+1 −1
Original line number Diff line number Diff line
@@ -599,7 +599,7 @@ public:
        Parcel data, reply;
        data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
        status_t status = remote()->transact(NEW_AUDIO_SESSION_ID, data, &reply);
        int id = 0;
        int id = AUDIO_SESSION_ALLOCATE;
        if (status == NO_ERROR) {
            id = reply.readInt32();
        }