Loading audio/aidl/default/bluetooth/ModuleBluetooth.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -299,7 +299,13 @@ ndk::ScopedAStatus ModuleBluetooth::createProxy(const AudioPort& audioPort, int3 : std::shared_ptr<BluetoothAudioPortAidl>( std::make_shared<BluetoothAudioPortAidlOut>()); const auto& devicePort = audioPort.ext.get<AudioPortExt::device>(); if (const auto device = devicePort.device.type; !proxy.ptr->registerPort(device)) { const auto device = devicePort.device.type; bool registrationSuccess = false; for (int i = 0; i < kCreateProxyRetries && !registrationSuccess; ++i) { registrationSuccess = proxy.ptr->registerPort(device); usleep(kCreateProxyRetrySleepMs * 1000); } if (!registrationSuccess) { LOG(ERROR) << __func__ << ": failed to register BT port for " << device.toString(); return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } Loading audio/aidl/default/include/core-impl/ModuleBluetooth.h +2 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,8 @@ class ModuleBluetooth final : public Module { ndk::ScopedAStatus findOrCreateProxy( const ::aidl::android::media::audio::common::AudioPort& audioPort, CachedProxy& proxy); static constexpr int kCreateProxyRetries = 5; static constexpr int kCreateProxyRetrySleepMs = 250; ChildInterface<BluetoothA2dp> mBluetoothA2dp; ChildInterface<BluetoothLe> mBluetoothLe; std::map<int32_t /*instantiated device port ID*/, CachedProxy> mProxies; Loading Loading
audio/aidl/default/bluetooth/ModuleBluetooth.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -299,7 +299,13 @@ ndk::ScopedAStatus ModuleBluetooth::createProxy(const AudioPort& audioPort, int3 : std::shared_ptr<BluetoothAudioPortAidl>( std::make_shared<BluetoothAudioPortAidlOut>()); const auto& devicePort = audioPort.ext.get<AudioPortExt::device>(); if (const auto device = devicePort.device.type; !proxy.ptr->registerPort(device)) { const auto device = devicePort.device.type; bool registrationSuccess = false; for (int i = 0; i < kCreateProxyRetries && !registrationSuccess; ++i) { registrationSuccess = proxy.ptr->registerPort(device); usleep(kCreateProxyRetrySleepMs * 1000); } if (!registrationSuccess) { LOG(ERROR) << __func__ << ": failed to register BT port for " << device.toString(); return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } Loading
audio/aidl/default/include/core-impl/ModuleBluetooth.h +2 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,8 @@ class ModuleBluetooth final : public Module { ndk::ScopedAStatus findOrCreateProxy( const ::aidl::android::media::audio::common::AudioPort& audioPort, CachedProxy& proxy); static constexpr int kCreateProxyRetries = 5; static constexpr int kCreateProxyRetrySleepMs = 250; ChildInterface<BluetoothA2dp> mBluetoothA2dp; ChildInterface<BluetoothLe> mBluetoothLe; std::map<int32_t /*instantiated device port ID*/, CachedProxy> mProxies; Loading