AudioSystem: add owner UID to setPhoneState API.
Communicate current audio mode owner UID to native service
when changing audio mode via setPhoneState.
This will be used by call audio capture restriction rules.
Bug: 148368476
Test: manual phone call tests
Change-Id: Icf6f168bb431b5232f6127877c40789c0c537bde
diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index 8bc2837..a91fd80 100644
--- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -121,7 +121,7 @@
device_name, encodedFormat);
}
-status_t AudioPolicyService::setPhoneState(audio_mode_t state)
+status_t AudioPolicyService::setPhoneState(audio_mode_t state, uid_t uid)
{
if (mAudioPolicyManager == NULL) {
return NO_INIT;
@@ -145,6 +145,7 @@
AutoCallerClear acc;
mAudioPolicyManager->setPhoneState(state);
mPhoneState = state;
+ mPhoneStateOwnerUid = uid;
return NO_ERROR;
}