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
This commit is contained in:
karthik bharadwaj 2021-01-13 00:19:00 -08:00
parent a326a59a36
commit df24582044
2 changed files with 13 additions and 0 deletions

View file

@ -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 {

View file

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