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

Commit 7dd4c762 authored by Kunal Malhotra's avatar Kunal Malhotra Committed by Android (Google) Code Review
Browse files

Merge "FGS Metrics Hooks for Microphone" into udc-dev

parents 52f25681 ae6d1602
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -72,9 +72,15 @@ public:
        ++mIntervalCount;
        const auto& mActivityManager = getActivityManager();
        if (mActivityManager) {
            if (mIsOut) {
                mActivityManager->logFgsApiBegin(AUDIO_API,
                    mUid,
                    IPCThreadState::self() -> getCallingPid());
            } else {
                mActivityManager->logFgsApiBegin(MICROPHONE_API,
                    mUid,
                    IPCThreadState::self() -> getCallingPid());
            }
        }
    }

@@ -107,9 +113,15 @@ public:
        }
        const auto& mActivityManager = getActivityManager();
        if (mActivityManager) {
            if (mIsOut) {
                mActivityManager->logFgsApiEnd(AUDIO_API,
                    mUid,
                    IPCThreadState::self() -> getCallingPid());
            } else {
                mActivityManager->logFgsApiEnd(MICROPHONE_API,
                    mUid,
                    IPCThreadState::self() -> getCallingPid());
            }
        }
    }

@@ -255,6 +267,7 @@ private:
    const bool        mIsOut;  // if true, than a playback track, otherwise used for record.

    static constexpr int AUDIO_API = 5;
    static constexpr int MICROPHONE_API = 6;
    const int         mUid;

    mutable           std::mutex mLock;