Loading audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +9 −13 Original line number Original line Diff line number Diff line Loading @@ -1755,13 +1755,12 @@ TEST_P(AudioCoreModule, SetVendorParameters) { TEST_P(AudioCoreModule, AddRemoveEffectInvalidArguments) { TEST_P(AudioCoreModule, AddRemoveEffectInvalidArguments) { ndk::ScopedAStatus addEffectStatus = module->addDeviceEffect(-1, nullptr); ndk::ScopedAStatus addEffectStatus = module->addDeviceEffect(-1, nullptr); ndk::ScopedAStatus removeEffectStatus = module->removeDeviceEffect(-1, nullptr); ndk::ScopedAStatus removeEffectStatus = module->removeDeviceEffect(-1, nullptr); const bool isSupported = addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION; if (addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { if (isSupported) { EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); } else if (EX_UNSUPPORTED_OPERATION != removeEffectStatus.getExceptionCode()) { } else if (removeEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { GTEST_FAIL() << "addEffect and removeEffect must be either supported or not supported " GTEST_FAIL() << "addDeviceEffect and removeDeviceEffect must be either supported or " << "together"; << "not supported together"; } else { } else { GTEST_SKIP() << "Offloaded effects not supported"; GTEST_SKIP() << "Offloaded effects not supported"; } } Loading Loading @@ -2128,15 +2127,13 @@ class AudioStream : public AudioCoreModule { ASSERT_NE(nullptr, streamCommon); ASSERT_NE(nullptr, streamCommon); ndk::ScopedAStatus addEffectStatus = streamCommon->addEffect(nullptr); ndk::ScopedAStatus addEffectStatus = streamCommon->addEffect(nullptr); ndk::ScopedAStatus removeEffectStatus = streamCommon->removeEffect(nullptr); ndk::ScopedAStatus removeEffectStatus = streamCommon->removeEffect(nullptr); const bool isSupported = addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION; if (addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { if (isSupported) { EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); atLeastOneSupports = true; atLeastOneSupports = true; } else if (EX_UNSUPPORTED_OPERATION != removeEffectStatus.getExceptionCode()) { } else if (removeEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { ADD_FAILURE() ADD_FAILURE() << "addEffect and removeEffect must be either supported or " << "addEffect and removeEffect must be either supported or not supported " << "not supported together"; << "together"; atLeastOneSupports = true; atLeastOneSupports = true; } } } } Loading Loading @@ -2458,10 +2455,10 @@ TEST_P(AudioStreamOut, LatencyMode) { ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port"; ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port"; WithStream<IStreamOut> stream(portConfig.value()); WithStream<IStreamOut> stream(portConfig.value()); ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames)); ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames)); bool isSupported = false; std::vector<AudioLatencyMode> supportedModes; std::vector<AudioLatencyMode> supportedModes; ndk::ScopedAStatus status = stream.get()->getRecommendedLatencyModes(&supportedModes); ndk::ScopedAStatus status = stream.get()->getRecommendedLatencyModes(&supportedModes); if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) continue; if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) continue; atLeastOneSupports = true; if (!status.isOk()) { if (!status.isOk()) { ADD_FAILURE() << "When latency modes are supported, getRecommendedLatencyModes " ADD_FAILURE() << "When latency modes are supported, getRecommendedLatencyModes " << "must succeed on a non-closed stream, but it failed with " << status; << "must succeed on a non-closed stream, but it failed with " << status; Loading @@ -2481,7 +2478,6 @@ TEST_P(AudioStreamOut, LatencyMode) { for (const auto mode : unsupportedModes) { for (const auto mode : unsupportedModes) { EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->setLatencyMode(mode)); EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->setLatencyMode(mode)); } } if (isSupported) atLeastOneSupports = true; } } if (!atLeastOneSupports) { if (!atLeastOneSupports) { GTEST_SKIP() << "Audio latency modes are not supported"; GTEST_SKIP() << "Audio latency modes are not supported"; Loading tv/tuner/aidl/default/Frontend.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,9 @@ Frontend::~Frontend() { // Reset callback // Reset callback mCallback = nullptr; mCallback = nullptr; mIsLocked = false; mIsLocked = false; if (mTuner != nullptr) { mTuner->removeFrontend(mId); mTuner->removeFrontend(mId); } mTuner = nullptr; mTuner = nullptr; return ::ndk::ScopedAStatus::ok(); return ::ndk::ScopedAStatus::ok(); Loading Loading
audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +9 −13 Original line number Original line Diff line number Diff line Loading @@ -1755,13 +1755,12 @@ TEST_P(AudioCoreModule, SetVendorParameters) { TEST_P(AudioCoreModule, AddRemoveEffectInvalidArguments) { TEST_P(AudioCoreModule, AddRemoveEffectInvalidArguments) { ndk::ScopedAStatus addEffectStatus = module->addDeviceEffect(-1, nullptr); ndk::ScopedAStatus addEffectStatus = module->addDeviceEffect(-1, nullptr); ndk::ScopedAStatus removeEffectStatus = module->removeDeviceEffect(-1, nullptr); ndk::ScopedAStatus removeEffectStatus = module->removeDeviceEffect(-1, nullptr); const bool isSupported = addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION; if (addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { if (isSupported) { EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); } else if (EX_UNSUPPORTED_OPERATION != removeEffectStatus.getExceptionCode()) { } else if (removeEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { GTEST_FAIL() << "addEffect and removeEffect must be either supported or not supported " GTEST_FAIL() << "addDeviceEffect and removeDeviceEffect must be either supported or " << "together"; << "not supported together"; } else { } else { GTEST_SKIP() << "Offloaded effects not supported"; GTEST_SKIP() << "Offloaded effects not supported"; } } Loading Loading @@ -2128,15 +2127,13 @@ class AudioStream : public AudioCoreModule { ASSERT_NE(nullptr, streamCommon); ASSERT_NE(nullptr, streamCommon); ndk::ScopedAStatus addEffectStatus = streamCommon->addEffect(nullptr); ndk::ScopedAStatus addEffectStatus = streamCommon->addEffect(nullptr); ndk::ScopedAStatus removeEffectStatus = streamCommon->removeEffect(nullptr); ndk::ScopedAStatus removeEffectStatus = streamCommon->removeEffect(nullptr); const bool isSupported = addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION; if (addEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { if (isSupported) { EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, addEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); EXPECT_EQ(EX_ILLEGAL_ARGUMENT, removeEffectStatus.getExceptionCode()); atLeastOneSupports = true; atLeastOneSupports = true; } else if (EX_UNSUPPORTED_OPERATION != removeEffectStatus.getExceptionCode()) { } else if (removeEffectStatus.getExceptionCode() != EX_UNSUPPORTED_OPERATION) { ADD_FAILURE() ADD_FAILURE() << "addEffect and removeEffect must be either supported or " << "addEffect and removeEffect must be either supported or not supported " << "not supported together"; << "together"; atLeastOneSupports = true; atLeastOneSupports = true; } } } } Loading Loading @@ -2458,10 +2455,10 @@ TEST_P(AudioStreamOut, LatencyMode) { ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port"; ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port"; WithStream<IStreamOut> stream(portConfig.value()); WithStream<IStreamOut> stream(portConfig.value()); ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames)); ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames)); bool isSupported = false; std::vector<AudioLatencyMode> supportedModes; std::vector<AudioLatencyMode> supportedModes; ndk::ScopedAStatus status = stream.get()->getRecommendedLatencyModes(&supportedModes); ndk::ScopedAStatus status = stream.get()->getRecommendedLatencyModes(&supportedModes); if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) continue; if (status.getExceptionCode() == EX_UNSUPPORTED_OPERATION) continue; atLeastOneSupports = true; if (!status.isOk()) { if (!status.isOk()) { ADD_FAILURE() << "When latency modes are supported, getRecommendedLatencyModes " ADD_FAILURE() << "When latency modes are supported, getRecommendedLatencyModes " << "must succeed on a non-closed stream, but it failed with " << status; << "must succeed on a non-closed stream, but it failed with " << status; Loading @@ -2481,7 +2478,6 @@ TEST_P(AudioStreamOut, LatencyMode) { for (const auto mode : unsupportedModes) { for (const auto mode : unsupportedModes) { EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->setLatencyMode(mode)); EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->setLatencyMode(mode)); } } if (isSupported) atLeastOneSupports = true; } } if (!atLeastOneSupports) { if (!atLeastOneSupports) { GTEST_SKIP() << "Audio latency modes are not supported"; GTEST_SKIP() << "Audio latency modes are not supported"; Loading
tv/tuner/aidl/default/Frontend.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,9 @@ Frontend::~Frontend() { // Reset callback // Reset callback mCallback = nullptr; mCallback = nullptr; mIsLocked = false; mIsLocked = false; if (mTuner != nullptr) { mTuner->removeFrontend(mId); mTuner->removeFrontend(mId); } mTuner = nullptr; mTuner = nullptr; return ::ndk::ScopedAStatus::ok(); return ::ndk::ScopedAStatus::ok(); Loading