Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11eef245 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "AudioPolicy: Log the construction duration to mediametrics" into tm-dev am: 380c49ce

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/17200579

Change-Id: I9e2d93692d8b050973c3af404ffe90a29d84e319
parents 28d7055f 380c49ce
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -114,6 +114,13 @@ void AudioPolicyService::loadAudioPolicyManager()

void AudioPolicyService::onFirstRef()
{
    // Log an AudioPolicy "constructor" mediametrics event on first ref.
    // This records the time it takes to load the audio modules and devices.
    mediametrics::Defer defer([beginNs = systemTime()] {
        mediametrics::LogItem(AMEDIAMETRICS_KEY_AUDIO_POLICY)
            .set(AMEDIAMETRICS_PROP_EVENT, AMEDIAMETRICS_PROP_EVENT_VALUE_CTOR)
            .set(AMEDIAMETRICS_PROP_EXECUTIONTIMENS, (int64_t)(systemTime() - beginNs))
            .record(); });
    {
        Mutex::Autolock _l(mLock);