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

Commit 1c6dfb4d authored by Jiabin Huang's avatar Jiabin Huang
Browse files

Revert "Add an API to query audio server death count."

Revert "Test if there is audio server crash happens while runnin..."

Revert submission 17199611-detectAudioServerCrash

Reason for revert: API council suggestion b/228991471 
Reverted Changes:
Idca2443d0:Add an API to query audio server death count.
Icb7c86b15:Test if there is audio server crash happens while ...

Change-Id: Idef058f87828d0d3222e92564588f0124b94fdde
parent 351e288d
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -91,13 +91,6 @@ AAUDIO_API aaudio_policy_t AAudio_getMMapPolicy();
 */
AAUDIO_API bool AAudioStream_isMMapUsed(AAudioStream* stream);

/**
 * Returns the count of audio server death.
 *
 * @return audio server death count.
 */
AAUDIO_API int AAudio_getAudioServerDeathCount();

#ifdef __cplusplus
}
#endif
+0 −5
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@

#include <aaudio/AAudio.h>
#include <aaudio/AAudioTesting.h>
#include <media/AudioSystem.h>
#include "AudioClock.h"
#include "AudioGlobal.h"
#include "AudioStreamBuilder.h"
@@ -605,7 +604,3 @@ AAUDIO_API aaudio_channel_mask_t AAudioStream_getChannelMask(AAudioStream* strea
    // Do not return channel index masks as they are not public.
    return AAudio_isChannelIndexMask(channelMask) ? AAUDIO_UNSPECIFIED : channelMask;
}

AAUDIO_API int AAudio_getAudioServerDeathCount() {
    return android::AudioSystem::getAudioFlingerDeathCount();
}
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ LIBAAUDIO {
    AAudio_convertResultToText;
    AAudio_convertStreamStateToText;
    AAudio_createStreamBuilder;
    AAudio_getAudioServerDeathCount;    # introduced=33
    AAudio_getMMapPolicy;
    AAudio_setMMapPolicy;
    AAudioStreamBuilder_setPerformanceMode;
+0 −10
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@
#define LOG_TAG "AudioSystem"
//#define LOG_NDEBUG 0

#include <atomic>

#include <utils/Log.h>

#include <android/media/IAudioPolicyService.h>
@@ -84,8 +82,6 @@ sp<CaptureStateListenerImpl> gSoundTriggerCaptureStateListener = nullptr;
// HotwordDetectionService.
sp<IBinder> gAudioFlingerBinder = nullptr;

std::atomic<int> gAudioFlingerDeathCount{0};

void AudioSystem::setAudioFlingerBinder(const sp<IBinder>& audioFlinger) {
    if (audioFlinger->getInterfaceDescriptor() != media::IAudioFlingerService::descriptor) {
        ALOGE("setAudioFlingerBinder: received a binder of type %s",
@@ -539,8 +535,6 @@ void AudioSystem::AudioFlingerClient::binderDied(const wp<IBinder>& who __unused

    reportError(DEAD_OBJECT);

    gAudioFlingerDeathCount += 1;

    ALOGW("AudioFlinger server died!");
}

@@ -2432,10 +2426,6 @@ int32_t AudioSystem::getAAudioHardwareBurstMinUsec() {
    return af->getAAudioHardwareBurstMinUsec();
}

int32_t AudioSystem::getAudioFlingerDeathCount() {
    return gAudioFlingerDeathCount.load();
}

// ---------------------------------------------------------------------------

int AudioSystem::AudioPolicyServiceClient::addAudioPortCallback(
+0 −5
Original line number Diff line number Diff line
@@ -564,11 +564,6 @@ public:
    static status_t getDirectProfilesForAttributes(const audio_attributes_t* attr,
                                            std::vector<audio_profile>* audioProfiles);

    /**
     * @return count of AudioFlinger death.
     */
    static int32_t getAudioFlingerDeathCount();

    // A listener for capture state changes.
    class CaptureStateListener : public virtual RefBase {
    public: