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<>);