Merge "AudioAttributes: fix setter for flags" into rvc-dev am: a750903b42

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

Change-Id: I7d563376daaf105b55f7941f77cdd24857aa1af1
This commit is contained in:
Jean-Michel Trivi
2020-06-26 03:50:11 +00:00
committed by Automerger Merge Worker

View File

@@ -452,6 +452,10 @@ public final class AudioAttributes implements Parcelable {
| FLAG_NO_SYSTEM_CAPTURE | FLAG_CAPTURE_PRIVATE;
private final static int FLAG_ALL_PUBLIC = FLAG_AUDIBILITY_ENFORCED |
FLAG_HW_AV_SYNC | FLAG_LOW_LATENCY;
/* mask of flags that can be set by SDK and System APIs through the Builder */
private static final int FLAG_ALL_API_SET = FLAG_ALL_PUBLIC
| FLAG_BYPASS_INTERRUPTION_POLICY
| FLAG_BYPASS_MUTE;
/**
* Indicates that the audio may be captured by any app.
@@ -838,7 +842,7 @@ public final class AudioAttributes implements Parcelable {
* @return the same Builder instance.
*/
public Builder setFlags(int flags) {
flags &= AudioAttributes.FLAG_ALL_PUBLIC;
flags &= AudioAttributes.FLAG_ALL_API_SET;
mFlags |= flags;
return this;
}