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

Commit 337f8ce4 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Propagate to apps capture opt-in



Allows public apps to detect if playback have opted-out of being
capture.

Bug: 129948989
Test: atest AudioPlaybackConfigurationTest
Change-Id: Id2c2ad195e5fdeba89926dcdbbe9fa22c2d25891
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent 13712a3b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package android.media;

import static android.media.AudioAttributes.ALLOW_CAPTURE_BY_ALL;
import static android.media.AudioAttributes.ALLOW_CAPTURE_BY_NONE;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi;
@@ -235,6 +238,9 @@ public final class AudioPlaybackConfiguration implements Parcelable {
                .setUsage(in.mPlayerAttr.getUsage())
                .setContentType(in.mPlayerAttr.getContentType())
                .setFlags(in.mPlayerAttr.getFlags())
                .setAllowedCapturePolicy(
                        in.mPlayerAttr.getAllowedCapturePolicy() == ALLOW_CAPTURE_BY_ALL
                        ? ALLOW_CAPTURE_BY_ALL : ALLOW_CAPTURE_BY_NONE)
                .build();
        // anonymized data
        anonymCopy.mPlayerType = PLAYER_TYPE_UNKNOWN;