Remove multiple calls to removeAudioDeviceCallback()
A call to stop() is already calling removeAudioDeviceCallback().
Further calls to the same is not needed
Bug: 267788926
Test: atest audiosystem_tests audiorouting_tests
Change-Id: Ib9fa1a786ad31008f44a80e3ae61e13eb01d854c
diff --git a/media/libaudioclient/tests/audiorouting_tests.cpp b/media/libaudioclient/tests/audiorouting_tests.cpp
index 2c5fcd7..19d1abc 100644
--- a/media/libaudioclient/tests/audiorouting_tests.cpp
+++ b/media/libaudioclient/tests/audiorouting_tests.cpp
@@ -73,7 +73,6 @@
}
}
ap->stop();
- ap->getAudioTrackHandle()->removeAudioDeviceCallback(cb);
}
}
diff --git a/media/libaudioclient/tests/audiosystem_tests.cpp b/media/libaudioclient/tests/audiosystem_tests.cpp
index ede62cc..b7a2d60 100644
--- a/media/libaudioclient/tests/audiosystem_tests.cpp
+++ b/media/libaudioclient/tests/audiosystem_tests.cpp
@@ -49,17 +49,11 @@
void TearDown() override {
if (mPlayback) {
mPlayback->stop();
- if (auto handle = mPlayback->getAudioTrackHandle(); handle) {
- handle->removeAudioDeviceCallback(mCbPlayback);
- }
mCbPlayback.clear();
mPlayback.clear();
}
if (mCapture) {
mCapture->stop();
- if (auto handle = mCapture->getAudioRecordHandle(); handle) {
- handle->removeAudioDeviceCallback(mCbRecord);
- }
mCbRecord.clear();
mCapture.clear();
}