summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJaideep Sharma <jaidshar@codeaurora.org>2020-01-23 16:26:02 +0530
committerEric Laurent <elaurent@google.com>2020-01-23 09:37:37 -0800
commit9e62926f251cc7137a0d74b7dcc39b0095323d9b (patch)
tree7696b236450f8139743ad69d4e7698f6c915725b /audio
parent5d372032d2f66c184ca8ee31a39f6ce068f33a0d (diff)
downloadplatform_hardware_interfaces-9e62926f251cc7137a0d74b7dcc39b0095323d9b.tar.gz
platform_hardware_interfaces-9e62926f251cc7137a0d74b7dcc39b0095323d9b.tar.bz2
platform_hardware_interfaces-9e62926f251cc7137a0d74b7dcc39b0095323d9b.zip
audiohal : add support for call_screen mode
Bug: 140384450 Test: make Change-Id: Iea7816ba35538e5ee966dae4f57abf147d203bd0
Diffstat (limited to 'audio')
-rw-r--r--audio/core/all-versions/default/PrimaryDevice.cpp3
-rw-r--r--audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp12
2 files changed, 14 insertions, 1 deletions
diff --git a/audio/core/all-versions/default/PrimaryDevice.cpp b/audio/core/all-versions/default/PrimaryDevice.cpp
index 679f85dad3..11c1c5a4df 100644
--- a/audio/core/all-versions/default/PrimaryDevice.cpp
+++ b/audio/core/all-versions/default/PrimaryDevice.cpp
@@ -203,6 +203,9 @@ Return<Result> PrimaryDevice::setMode(AudioMode mode) {
case AudioMode::RINGTONE:
case AudioMode::IN_CALL:
case AudioMode::IN_COMMUNICATION:
+#if MAJOR_VERSION >= 6
+ case AudioMode::CALL_SCREEN:
+#endif
break; // Valid values
default:
return Result::INVALID_ARGUMENTS;
diff --git a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
index 709b7cd369..b0eb2e0cfb 100644
--- a/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
+++ b/audio/core/all-versions/vts/functional/4.0/AudioPrimaryHidlHalTest.cpp
@@ -244,7 +244,13 @@ TEST_P(OutputStreamTest, updateSourceMetadata) {
TEST_P(AudioPrimaryHidlTest, setMode) {
doc::test("Make sure setMode always succeeds if mode is valid and fails otherwise");
// Test Invalid values
- for (int mode : {-2, -1, int(AudioMode::IN_COMMUNICATION) + 1}) {
+#if MAJOR_VERSION >= 6
+ int maxMode = int(AudioMode::CALL_SCREEN);
+#else
+ int maxMode = int(AudioMode::IN_COMMUNICATION);
+#endif
+
+ for (int mode : {-2, -1, maxMode + 1}) {
ASSERT_RESULT(Result::INVALID_ARGUMENTS, getDevice()->setMode(AudioMode(mode)))
<< "mode=" << mode;
}
@@ -253,6 +259,10 @@ TEST_P(AudioPrimaryHidlTest, setMode) {
AudioMode::NORMAL /* Make sure to leave the test in normal mode */}) {
ASSERT_OK(getDevice()->setMode(mode)) << "mode=" << toString(mode);
}
+ // AudioMode::CALL_SCREEN as support is optional
+#if MAJOR_VERSION >= 6
+ ASSERT_RESULT(okOrNotSupportedOrInvalidArgs, getDevice()->setMode(AudioMode::CALL_SCREEN));
+#endif
}
TEST_P(AudioPrimaryHidlTest, setBtHfpSampleRate) {