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

Commit ab659d66 authored by Andy Hung's avatar Andy Hung
Browse files

Audio Aidl: Set callback priority

Flag: EXEMPT bugfix
Test: compiles
Bug: 368553737
Change-Id: Ie88bf21ee898a01fd352afcced0971513fd7d66d
parent e6071181
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <aidl/android/hardware/audio/core/BnStreamCallback.h>
#include <aidl/android/hardware/audio/core/BnStreamOutEventCallback.h>
#include <aidl/android/hardware/audio/core/StreamDescriptor.h>
#include <android/binder_ibinder_platform.h>
#include <error/expected_utils.h>
#include <media/AidlConversionCppNdk.h>
#include <media/AidlConversionNdk.h>
@@ -29,6 +30,8 @@
#include <media/AidlConversionUtil.h>
#include <mediautils/TimeCheck.h>
#include <system/audio.h>
#include <system/thread_defs.h>

#include <Utils.h>
#include <utils/Log.h>

@@ -504,8 +507,15 @@ status_t DeviceHalAidl::openOutputStream(
    std::shared_ptr<OutputStreamCallbackAidl> streamCb;
    if (isOffload) {
        streamCb = ndk::SharedRefBase::make<OutputStreamCallbackAidl>(this);
        ndk::SpAIBinder binder = streamCb->asBinder();
        AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
        AIBinder_setInheritRt(binder.get(), true);
    }
    auto eventCb = ndk::SharedRefBase::make<OutputStreamEventCallbackAidl>(this);
    ndk::SpAIBinder binder = eventCb->asBinder();
    AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
    AIBinder_setInheritRt(binder.get(), true);

    if (isOffload || isHwAvSync) {
        args.offloadInfo = aidlConfig.offloadInfo;
    }