audio policy: add audio policy ready flag.
The audio policy ready flag indicates that audio policy manager
intialization is done and that audioflinger can call back
into audio policy service without risk of deadlocking because the
service is not published yet.
Bug: 188502620
Test: boot and kill native audioserver process.
Change-Id: I671ed0aadd0c51342be5b57d1afb7577da6a7fa9
(cherry picked from commit d66d7a155b9a90463d3e4b8ef6a5cd900b087846)
Merged-In: I671ed0aadd0c51342be5b57d1afb7577da6a7fa9
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 6cdb3cd..f16549c 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2456,6 +2456,10 @@
ThreadBase *thread = (ThreadBase *)mRecordThreads.valueAt(i).get();
thread->systemReady();
}
+ for (size_t i = 0; i < mMmapThreads.size(); i++) {
+ ThreadBase *thread = (ThreadBase *)mMmapThreads.valueAt(i).get();
+ thread->systemReady();
+ }
return NO_ERROR;
}
@@ -4179,6 +4183,7 @@
case TransactionCode::LIST_AUDIO_PATCHES:
case TransactionCode::SET_AUDIO_PORT_CONFIG:
case TransactionCode::SET_RECORD_SILENCED:
+ case TransactionCode::AUDIO_POLICY_READY:
ALOGW("%s: transaction %d received from PID %d",
__func__, code, IPCThreadState::self()->getCallingPid());
// return status only for non void methods