Apply Assistant AudioPolicy to HotwordDetectionService
The HotwordDetectionService is part of the Assistant package but runs
with a separate (isolated) uid.
This change follows the pattern of how the Assistant and IME UIDs are
set.
Fix: 194368677
Test: manual - hotword works when another app is using the mic and in
Auto projection mode
Test: atest HotwordDetectionServiceBasicTest
Change-Id: I76a7930431db226c7e502f8993dfeaa4bc133bea
diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index 9987252..77223b6 100644
--- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -1916,6 +1916,14 @@
return Status::ok();
}
+Status AudioPolicyService::setHotwordDetectionServiceUid(int32_t uidAidl)
+{
+ uid_t uid = VALUE_OR_RETURN_BINDER_STATUS(aidl2legacy_int32_t_uid_t(uidAidl));
+ Mutex::Autolock _l(mLock);
+ mUidPolicy->setHotwordDetectionServiceUid(uid);
+ return Status::ok();
+}
+
Status AudioPolicyService::setA11yServicesUids(const std::vector<int32_t>& uidsAidl)
{
size_t size = uidsAidl.size();