diff --git a/audio/aidl/default/ModulePrimary.cpp b/audio/aidl/default/ModulePrimary.cpp index cbb6730372..f66da373f9 100644 --- a/audio/aidl/default/ModulePrimary.cpp +++ b/audio/aidl/default/ModulePrimary.cpp @@ -38,7 +38,8 @@ ndk::ScopedAStatus ModulePrimary::getTelephony(std::shared_ptr* _aid mTelephony = ndk::SharedRefBase::make(); } *_aidl_return = mTelephony.getPtr(); - LOG(DEBUG) << __func__ << ": returning instance of ITelephony: " << _aidl_return->get(); + LOG(DEBUG) << __func__ + << ": returning instance of ITelephony: " << _aidl_return->get()->asBinder().get(); return ndk::ScopedAStatus::ok(); } diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp index 470b65b749..b11edff8e4 100644 --- a/audio/aidl/default/Stream.cpp +++ b/audio/aidl/default/Stream.cpp @@ -603,18 +603,16 @@ StreamCommonImpl::~StreamCommonImpl() { ndk::ScopedAStatus StreamCommonImpl::initInstance( const std::shared_ptr& delegate) { mCommon = ndk::SharedRefBase::make(delegate); - mCommonBinder = mCommon->asBinder(); - AIBinder_setMinSchedulerPolicy(mCommonBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO); return mWorker->start() ? ndk::ScopedAStatus::ok() : ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } ndk::ScopedAStatus StreamCommonImpl::getStreamCommonCommon( std::shared_ptr* _aidl_return) { - if (mCommon == nullptr) { + if (!mCommon) { LOG(FATAL) << __func__ << ": the common interface was not created"; } - *_aidl_return = mCommon; + *_aidl_return = mCommon.getPtr(); LOG(DEBUG) << __func__ << ": returning " << _aidl_return->get()->asBinder().get(); return ndk::ScopedAStatus::ok(); } diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h index a1bc9b4b85..b65efb26f2 100644 --- a/audio/aidl/default/include/core-impl/Stream.h +++ b/audio/aidl/default/include/core-impl/Stream.h @@ -43,6 +43,7 @@ #include #include +#include "core-impl/ChildInterface.h" #include "core-impl/utils.h" namespace aidl::android::hardware::audio::core { @@ -466,8 +467,7 @@ class StreamCommonImpl : virtual public StreamCommonInterface, virtual public Dr Metadata mMetadata; StreamContext mContext; std::unique_ptr mWorker; - std::shared_ptr mCommon; - ndk::SpAIBinder mCommonBinder; + ChildInterface mCommon; ConnectedDevices mConnectedDevices; }; diff --git a/audio/aidl/default/stub/ModuleStub.cpp b/audio/aidl/default/stub/ModuleStub.cpp index a60075221d..72f2241c03 100644 --- a/audio/aidl/default/stub/ModuleStub.cpp +++ b/audio/aidl/default/stub/ModuleStub.cpp @@ -38,7 +38,8 @@ ndk::ScopedAStatus ModuleStub::getBluetooth(std::shared_ptr* _aidl_r mBluetooth = ndk::SharedRefBase::make(); } *_aidl_return = mBluetooth.getPtr(); - LOG(DEBUG) << __func__ << ": returning instance of IBluetooth: " << _aidl_return->get(); + LOG(DEBUG) << __func__ + << ": returning instance of IBluetooth: " << _aidl_return->get()->asBinder().get(); return ndk::ScopedAStatus::ok(); } @@ -47,7 +48,8 @@ ndk::ScopedAStatus ModuleStub::getBluetoothA2dp(std::shared_ptr* mBluetoothA2dp = ndk::SharedRefBase::make(); } *_aidl_return = mBluetoothA2dp.getPtr(); - LOG(DEBUG) << __func__ << ": returning instance of IBluetoothA2dp: " << _aidl_return->get(); + LOG(DEBUG) << __func__ << ": returning instance of IBluetoothA2dp: " + << _aidl_return->get()->asBinder().get(); return ndk::ScopedAStatus::ok(); } @@ -56,7 +58,8 @@ ndk::ScopedAStatus ModuleStub::getBluetoothLe(std::shared_ptr* _ai mBluetoothLe = ndk::SharedRefBase::make(); } *_aidl_return = mBluetoothLe.getPtr(); - LOG(DEBUG) << __func__ << ": returning instance of IBluetoothLe: " << _aidl_return->get(); + LOG(DEBUG) << __func__ + << ": returning instance of IBluetoothLe: " << _aidl_return->get()->asBinder().get(); return ndk::ScopedAStatus::ok(); }