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

Commit a53a94d8 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11938003 from 8b948c43 to 24Q3-release

Change-Id: I0ce9ef6d208e1be0c42c4bdb8808129b3ae3d52a
parents 3f19aa45 8b948c43
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1115,6 +1115,17 @@ AAUDIO_API void AAudioStreamBuilder_setPerformanceMode(AAudioStreamBuilder* _Non
 *
 * The default, if you do not call this function, is {@link #AAUDIO_USAGE_MEDIA}.
 *
 * If you set Usage then you will need to associate the volume keys with the resulting stream.
 * Otherwise the volume keys may not work correctly.
 * This is done in Java with the following code block.
 *
 * <pre><code>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
 *     AudioAttributes attributes = new AudioAttributes.Builder().setUsage(usage)
 *             .setContentType(contentType).build();
 *     setVolumeControlStream(attributes.getVolumeControlStream());
 * }
 * </code></pre>
 *
 * Available since API level 28.
 *
 * @param builder reference provided by AAudio_createStreamBuilder()
@@ -1132,6 +1143,17 @@ AAUDIO_API void AAudioStreamBuilder_setUsage(AAudioStreamBuilder* _Nonnull build
 *
 * The default, if you do not call this function, is {@link #AAUDIO_CONTENT_TYPE_MUSIC}.
 *
 * If you set ContentType then you will need to associate the volume keys with the resulting stream.
 * Otherwise the volume keys may not work correctly.
 * This is done in Java with the following code block.
 *
 * <pre><code>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
 *     AudioAttributes attributes = new AudioAttributes.Builder().setUsage(usage)
 *             .setContentType(contentType).build();
 *     setVolumeControlStream(attributes.getVolumeControlStream());
 * }
 * </code></pre>
 *
 * Available since API level 28.
 *
 * @param builder reference provided by AAudio_createStreamBuilder()
+10 −0
Original line number Diff line number Diff line
@@ -923,6 +923,11 @@ status_t AudioFlingerClientAdapter::setTracksInternalMute(
    return statusTFromBinderStatus(mDelegate->setTracksInternalMute(tracksInternalMuted));
}

status_t AudioFlingerClientAdapter::resetReferencesForTest() {
    RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(mDelegate->resetReferencesForTest()));
    return OK;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// AudioFlingerServerAdapter
AudioFlingerServerAdapter::AudioFlingerServerAdapter(
@@ -1487,4 +1492,9 @@ Status AudioFlingerServerAdapter::setTracksInternalMute(
    return Status::fromStatusT(mDelegate->setTracksInternalMute(tracksInternalMute));
}

Status AudioFlingerServerAdapter::resetReferencesForTest() {
    RETURN_BINDER_IF_ERROR(mDelegate->resetReferencesForTest());
    return Status::ok();
}

} // namespace android
+6 −0
Original line number Diff line number Diff line
@@ -299,6 +299,12 @@ interface IAudioFlingerService {
     */
    void setTracksInternalMute(in TrackInternalMuteInfo[] tracksInternalMute);

    /*
     * Reset Circular references in AudioFlinger service.
     * Test API
     */
     void resetReferencesForTest();

    // When adding a new method, please review and update
    // IAudioFlinger.h AudioFlingerServerAdapter::Delegate::TransactionCode
    // AudioFlinger.cpp AudioFlinger::onTransactWrapper()
+6 −0
Original line number Diff line number Diff line
@@ -392,6 +392,8 @@ public:

    virtual status_t setTracksInternalMute(
            const std::vector<media::TrackInternalMuteInfo>& tracksInternalMute) = 0;

    virtual status_t resetReferencesForTest() = 0;
};

/**
@@ -510,6 +512,7 @@ public:
                             struct audio_port_v7 *mixPort) const override;
    status_t setTracksInternalMute(
            const std::vector<media::TrackInternalMuteInfo>& tracksInternalMute) override;
    status_t resetReferencesForTest() override;

private:
    const sp<media::IAudioFlingerService> mDelegate;
@@ -613,6 +616,8 @@ public:
                    media::BnAudioFlingerService::TRANSACTION_getAudioPolicyConfig,
            GET_AUDIO_MIX_PORT = media::BnAudioFlingerService::TRANSACTION_getAudioMixPort,
            SET_TRACKS_INTERNAL_MUTE = media::BnAudioFlingerService::TRANSACTION_setTracksInternalMute,
            RESET_REFERENCES_FOR_TEST =
                    media::BnAudioFlingerService::TRANSACTION_resetReferencesForTest,
        };

    protected:
@@ -751,6 +756,7 @@ public:
                           media::AudioPortFw* _aidl_return) override;
    Status setTracksInternalMute(
            const std::vector<media::TrackInternalMuteInfo>& tracksInternalMute) override;
    Status resetReferencesForTest() override;
private:
    const sp<AudioFlingerServerAdapter::Delegate> mDelegate;
};
+11 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ BINDER_METHOD_ENTRY(supportsBluetoothVariableLatency) \
BINDER_METHOD_ENTRY(getSoundDoseInterface) \
BINDER_METHOD_ENTRY(getAudioPolicyConfig) \
BINDER_METHOD_ENTRY(getAudioMixPort) \
BINDER_METHOD_ENTRY(resetReferencesForTest) \

// singleton for Binder Method Statistics for IAudioFlinger
static auto& getIAudioFlingerStatistics() {
@@ -466,6 +467,8 @@ AudioFlinger::~AudioFlinger()
            sMediaLogService->unregisterWriter(iMemory);
        }
    }
    mMediaLogNotifier->requestExit();
    mPatchCommandThread->exit();
}

//static
@@ -4986,6 +4989,13 @@ status_t AudioFlinger::setTracksInternalMute(
    return NO_ERROR;
}

status_t AudioFlinger::resetReferencesForTest() {
    mDeviceEffectManager.clear();
    mPatchPanel.clear();
    mMelReporter->resetReferencesForTest();
    return NO_ERROR;
}

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

status_t AudioFlinger::onTransactWrapper(TransactionCode code,
@@ -5021,6 +5031,7 @@ status_t AudioFlinger::onTransactWrapper(TransactionCode code,
        case TransactionCode::GET_AUDIO_POLICY_CONFIG:
        case TransactionCode::GET_AUDIO_MIX_PORT:
        case TransactionCode::SET_TRACKS_INTERNAL_MUTE:
        case TransactionCode::RESET_REFERENCES_FOR_TEST:
            ALOGW("%s: transaction %d received from PID %d",
                  __func__, static_cast<int>(code), IPCThreadState::self()->getCallingPid());
            // return status only for non void methods
Loading