Loading flags/system_service.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -32,3 +32,13 @@ flag { } bug: "338079154" } flag { name: "audio_port_binder_inherit_rt" namespace: "bluetooth" description: "Allow audio port AIDL thread to inherit thread priority from its caller" bug: "335049159" metadata { purpose: PURPOSE_BUGFIX } } system/audio_hal_interface/aidl/bluetooth_audio_port_impl.cc +13 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ #include "bluetooth_audio_port_impl.h" #include <bluetooth/log.h> #include <com_android_bluetooth_flags.h> #include <vector> #include "android/binder_ibinder_platform.h" #include "btif/include/btif_common.h" #include "common/stop_watch_legacy.h" Loading Loading @@ -226,6 +228,17 @@ PresentationPosition::TimeSpec BluetoothAudioPortImpl::timespec_convert_to_hal( .tvNSec = static_cast<int64_t>(ts.tv_nsec)}; } // Overriding create binder and inherit RT from caller. // In our case, the caller is the AIDL session control, so we match the priority // of the AIDL session / AudioFlinger writer thread. ndk::SpAIBinder BluetoothAudioPortImpl::createBinder() { auto binder = BnBluetoothAudioPort::createBinder(); if (com::android::bluetooth::flags::audio_port_binder_inherit_rt()) { AIBinder_setInheritRt(binder.get(), true); } return binder; } } // namespace aidl } // namespace audio } // namespace bluetooth system/audio_hal_interface/aidl/bluetooth_audio_port_impl.h +3 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ class BluetoothAudioPortImpl : public BnBluetoothAudioPort { private: ndk::ScopedAStatus switchCodec(bool isLowLatency); ndk::SpAIBinder createBinder() override; }; } // namespace aidl Loading Loading
flags/system_service.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -32,3 +32,13 @@ flag { } bug: "338079154" } flag { name: "audio_port_binder_inherit_rt" namespace: "bluetooth" description: "Allow audio port AIDL thread to inherit thread priority from its caller" bug: "335049159" metadata { purpose: PURPOSE_BUGFIX } }
system/audio_hal_interface/aidl/bluetooth_audio_port_impl.cc +13 −0 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ #include "bluetooth_audio_port_impl.h" #include <bluetooth/log.h> #include <com_android_bluetooth_flags.h> #include <vector> #include "android/binder_ibinder_platform.h" #include "btif/include/btif_common.h" #include "common/stop_watch_legacy.h" Loading Loading @@ -226,6 +228,17 @@ PresentationPosition::TimeSpec BluetoothAudioPortImpl::timespec_convert_to_hal( .tvNSec = static_cast<int64_t>(ts.tv_nsec)}; } // Overriding create binder and inherit RT from caller. // In our case, the caller is the AIDL session control, so we match the priority // of the AIDL session / AudioFlinger writer thread. ndk::SpAIBinder BluetoothAudioPortImpl::createBinder() { auto binder = BnBluetoothAudioPort::createBinder(); if (com::android::bluetooth::flags::audio_port_binder_inherit_rt()) { AIBinder_setInheritRt(binder.get(), true); } return binder; } } // namespace aidl } // namespace audio } // namespace bluetooth
system/audio_hal_interface/aidl/bluetooth_audio_port_impl.h +3 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ class BluetoothAudioPortImpl : public BnBluetoothAudioPort { private: ndk::ScopedAStatus switchCodec(bool isLowLatency); ndk::SpAIBinder createBinder() override; }; } // namespace aidl Loading