From df24582044d2790b573a3bc473c784e88a9109c4 Mon Sep 17 00:00:00 2001 From: karthik bharadwaj Date: Wed, 13 Jan 2021 00:19:00 -0800 Subject: [PATCH] Update ContextHub HAL 1.2 Update ContextHub HAL 1.2 to include support for the Global Microphone Access Disable user setting. Bug: 174691697 Test: run vts -m VtsHalContexthubV1_2TargetTest -t ContexthubHidlTest Change-Id: I11bce59069fa97010b66f194a9ccc01a5b81f808 --- contexthub/1.2/types.hal | 6 ++++++ .../1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/contexthub/1.2/types.hal b/contexthub/1.2/types.hal index e6c8acc57d..5a11efea46 100644 --- a/contexthub/1.2/types.hal +++ b/contexthub/1.2/types.hal @@ -33,6 +33,12 @@ enum Setting : @1.1::Setting { */ WIFI_AVAILABLE, AIRPLANE_MODE, + + /** + * Indicates if the microphone access was turned off globally by the user, + * in which case audio data cannot be used and propagated by CHRE. + */ + GLOBAL_MIC_DISABLE, }; struct ContextHubMsg { diff --git a/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp b/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp index 77883c2423..782edae610 100644 --- a/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp +++ b/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp @@ -62,6 +62,13 @@ TEST_P(ContexthubHidlTest, TestOnAirplaneModeSettingChanged) { ASSERT_OK(registerCallback(nullptr)); } +TEST_P(ContexthubHidlTest, TestOnGlobalMicDisableSettingChanged) { + ASSERT_OK(registerCallback(new ContexthubCallbackBase())); + hubApi->onSettingChanged_1_2(Setting::GLOBAL_MIC_DISABLE, SettingValue::DISABLED); + hubApi->onSettingChanged_1_2(Setting::GLOBAL_MIC_DISABLE, SettingValue::ENABLED); + ASSERT_OK(registerCallback(nullptr)); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ContexthubHidlTest); INSTANTIATE_TEST_SUITE_P(HubIdSpecificTests, ContexthubHidlTest, testing::ValuesIn(kTestParameters), android::hardware::PrintInstanceTupleNameToString<>);