Allow DEFAULT_INPUT_METHOD to capture audio during RTT call
The UID of the current InputMethodService (DEFAULT_INPUT_METHOD) is
pushed from AudioService to AudioPolicyService via AudioSystem.
Allow capture audio if:
- the UID is the current InputMethodService's UID,
- AND a RTT call is active,
- AND the source is AUDIO_SOURCE_VOICE_RECOGNITION.
Bug: 147037345
Test: use voice input with Gboard 9.1.4 during a simulated RTT call.
Change-Id: Ib32ec25e962833eddd0320742e177e3c1e0e5c05
diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index 57b23b7..6d79c94 100644
--- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -1420,6 +1420,13 @@
return NO_ERROR;
}
+status_t AudioPolicyService::setCurrentImeUid(uid_t uid)
+{
+ Mutex::Autolock _l(mLock);
+ mUidPolicy->setCurrentImeUid(uid);
+ return NO_ERROR;
+}
+
bool AudioPolicyService::isHapticPlaybackSupported()
{
if (mAudioPolicyManager == NULL) {