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
diff --git a/contexthub/1.2/types.hal b/contexthub/1.2/types.hal
index e6c8acc..5a11efe 100644
--- a/contexthub/1.2/types.hal
+++ b/contexthub/1.2/types.hal
@@ -33,6 +33,12 @@
*/
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 77883c2..782edae 100644
--- a/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp
+++ b/contexthub/1.2/vts/functional/VtsHalContexthubV1_2TargetTest.cpp
@@ -62,6 +62,13 @@
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<>);