Loading audio/aidl/default/StreamSwitcher.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -126,11 +126,10 @@ ndk::ScopedAStatus StreamSwitcher::removeEffect(const std::shared_ptr<IEffect>& LOG(ERROR) << __func__ << ": stream was closed"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } for (auto it = mEffects.begin(); it != mEffects.end();) { for (auto it = mEffects.begin(); it != mEffects.end(); ++it) { if ((*it)->asBinder() == in_effect->asBinder()) { it = mEffects.erase(it); } else { ++it; mEffects.erase(it); break; } } return !mIsStubStream ? mStream->removeEffect(in_effect) : ndk::ScopedAStatus::ok(); Loading Loading @@ -201,6 +200,10 @@ ndk::ScopedAStatus StreamSwitcher::setConnectedDevices(const std::vector<AudioDe } // The delegate is null because StreamSwitcher handles IStreamCommon methods by itself. if (ndk::ScopedAStatus status = mStream->initInstance(nullptr); !status.isOk()) { if (mIsStubStream) { LOG(FATAL) << __func__ << ": failed to initialize stub stream: " << status.getDescription(); } // Need to close the current failed stream, and report an error. // Since we can't operate without a stream implementation, put a stub in. RETURN_STATUS_IF_ERROR(closeCurrentStream(false /*validateStreamState*/)); Loading audio/aidl/default/alsa/Mixer.h +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ class Mixer { std::mutex mMixerAccess; // The mixer object is owned by ALSA and will be released when the mixer is closed. struct mixer* const mMixer; // `mMixerControls` will only be initialized in constructor. After that, it wil only be // `mMixerControls` will only be initialized in constructor. After that, it will only be // read but not be modified. Each mixer_ctl object is owned by ALSA, it's life span is // the same as of the mixer itself. const Controls mMixerControls; Loading audio/aidl/default/include/core-impl/StreamSwitcher.h +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ namespace aidl::android::hardware::audio::core { // 'StreamSwitcher' is implementation of 'StreamCommonInterface' which allows // 'StreamSwitcher' is an implementation of 'StreamCommonInterface' which allows // dynamically switching the underlying stream implementation based on currently // connected devices. This is achieved by replacing inheritance from // 'StreamCommonImpl' with owning an instance of it. StreamSwitcher must be Loading Loading
audio/aidl/default/StreamSwitcher.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -126,11 +126,10 @@ ndk::ScopedAStatus StreamSwitcher::removeEffect(const std::shared_ptr<IEffect>& LOG(ERROR) << __func__ << ": stream was closed"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } for (auto it = mEffects.begin(); it != mEffects.end();) { for (auto it = mEffects.begin(); it != mEffects.end(); ++it) { if ((*it)->asBinder() == in_effect->asBinder()) { it = mEffects.erase(it); } else { ++it; mEffects.erase(it); break; } } return !mIsStubStream ? mStream->removeEffect(in_effect) : ndk::ScopedAStatus::ok(); Loading Loading @@ -201,6 +200,10 @@ ndk::ScopedAStatus StreamSwitcher::setConnectedDevices(const std::vector<AudioDe } // The delegate is null because StreamSwitcher handles IStreamCommon methods by itself. if (ndk::ScopedAStatus status = mStream->initInstance(nullptr); !status.isOk()) { if (mIsStubStream) { LOG(FATAL) << __func__ << ": failed to initialize stub stream: " << status.getDescription(); } // Need to close the current failed stream, and report an error. // Since we can't operate without a stream implementation, put a stub in. RETURN_STATUS_IF_ERROR(closeCurrentStream(false /*validateStreamState*/)); Loading
audio/aidl/default/alsa/Mixer.h +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ class Mixer { std::mutex mMixerAccess; // The mixer object is owned by ALSA and will be released when the mixer is closed. struct mixer* const mMixer; // `mMixerControls` will only be initialized in constructor. After that, it wil only be // `mMixerControls` will only be initialized in constructor. After that, it will only be // read but not be modified. Each mixer_ctl object is owned by ALSA, it's life span is // the same as of the mixer itself. const Controls mMixerControls; Loading
audio/aidl/default/include/core-impl/StreamSwitcher.h +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ namespace aidl::android::hardware::audio::core { // 'StreamSwitcher' is implementation of 'StreamCommonInterface' which allows // 'StreamSwitcher' is an implementation of 'StreamCommonInterface' which allows // dynamically switching the underlying stream implementation based on currently // connected devices. This is achieved by replacing inheritance from // 'StreamCommonImpl' with owning an instance of it. StreamSwitcher must be Loading