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

Commit 99ad37a4 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "AudioSystem: new audioflinger restart detection" into klp-dev

parents c8b226f4 46291616
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -252,6 +252,9 @@ public:
    // bit rate, duration, video and streaming or offload property is enabled
    static bool isOffloadSupported(const audio_offload_info_t& info);

    // check presence of audio flinger service.
    // returns NO_ERROR if binding to service succeeds, DEAD_OBJECT otherwise
    static status_t checkAudioFlinger();
    // ----------------------------------------------------------------------------

private:
+8 −0
Original line number Diff line number Diff line
@@ -76,6 +76,14 @@ const sp<IAudioFlinger>& AudioSystem::get_audio_flinger()
    return gAudioFlinger;
}

/* static */ status_t AudioSystem::checkAudioFlinger()
{
    if (defaultServiceManager()->checkService(String16("media.audio_flinger")) != 0) {
        return NO_ERROR;
    }
    return DEAD_OBJECT;
}

status_t AudioSystem::muteMicrophone(bool state) {
    const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
    if (af == 0) return PERMISSION_DENIED;