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

Commit 73efbca9 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix capture policy for assistant when running as top

Under regular circumstances, an app with the assistant role should
be applied the same concurrent capture policy as any other app.

Current implementation would apply more restrictions to an assistant than
to a regular app when running as top.

Bug: 355644902
Flag: EXEMPT bug fix
Test: regression for various audio capture scenarii
Change-Id: Ifd12ea4590ebbdc9224ce1f2142ffb33da5ac002
parent cb70cc43
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1039,6 +1039,9 @@ void AudioPolicyService::updateUidStates_l()
            current->attributionSource.uid == topSensitiveActive->attributionSource.uid;
        bool isTopOrLatestAssistant = latestActiveAssistant == nullptr ? false :
            current->attributionSource.uid == latestActiveAssistant->attributionSource.uid;
        bool isActiveAssistant =
                (useActiveAssistantList && mUidPolicy->isActiveAssistantUid(currentUid))
                    || mUidPolicy->isAssistantUid(currentUid);

        // TODO: b/339112720
        // Refine this logic when we have the correct phone state owner UID. The current issue is
@@ -1067,7 +1070,7 @@ void AudioPolicyService::updateUidStates_l()
        const bool allowSensitiveCapture =
            !isSensitiveActive || isTopOrLatestSensitive || current->canCaptureOutput;
        bool allowCapture = false;
        if (!isAssistantOnTop) {
        if (!isAssistantOnTop || isActiveAssistant) {
            allowCapture = (isTopOrLatestActive || isTopOrLatestSensitive) &&
                           allowSensitiveCapture && canCaptureIfInCallOrCommunication;
        } else {