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/main.cpp b/audio/aidl/default/main.cpp
index 15874a0..7786cc6 100644
--- a/audio/aidl/default/main.cpp
+++ b/audio/aidl/default/main.cpp
@@ -21,6 +21,7 @@
#include "core-impl/Module.h"
#include <android-base/logging.h>
+#include <android/binder_ibinder_platform.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
@@ -44,6 +45,8 @@
// Make the default module
auto moduleDefault = ndk::SharedRefBase::make<Module>();
+ AIBinder_setMinSchedulerPolicy(moduleDefault->asBinder().get(), SCHED_NORMAL,
+ ANDROID_PRIORITY_AUDIO);
const std::string moduleDefaultName = std::string() + Module::descriptor + "/default";
status = AServiceManager_addService(moduleDefault->asBinder().get(), moduleDefaultName.c_str());
CHECK_EQ(STATUS_OK, status);