Audio AIDL HAL priority update
Enable RT priority inheritance.
Set minimum Audio AIDL HAL Binder access priority to ANDROID_PRIORITY_AUDIO.
Bug: 261496726
Test: atest VtsHalAudioEffectTargetTest
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I584d80f4fe344e4bfae5765cac2afb92313b6a39
diff --git a/audio/aidl/default/EffectFactory.cpp b/audio/aidl/default/EffectFactory.cpp
index 820b447..74ed780 100644
--- a/audio/aidl/default/EffectFactory.cpp
+++ b/audio/aidl/default/EffectFactory.cpp
@@ -15,10 +15,13 @@
*/
#define LOG_TAG "AHAL_EffectFactory"
-#include <android-base/logging.h>
#include <dlfcn.h>
#include <unordered_set>
+#include <android-base/logging.h>
+#include <android/binder_ibinder_platform.h>
+#include <system/thread_defs.h>
+
#include "effect-impl/EffectTypes.h"
#include "effect-impl/EffectUUID.h"
#include "effectFactory-impl/EffectFactory.h"
@@ -109,6 +112,8 @@
return ndk::ScopedAStatus::fromExceptionCode(EX_TRANSACTION_FAILED);
}
*_aidl_return = effectSp;
+ AIBinder_setMinSchedulerPolicy(effectSp->asBinder().get(), SCHED_NORMAL,
+ ANDROID_PRIORITY_AUDIO);
mEffectUuidMap[std::weak_ptr<IEffect>(effectSp)] = in_impl_uuid;
LOG(DEBUG) << __func__ << ": instance " << effectSp.get() << " created successfully";
return ndk::ScopedAStatus::ok();