AudioAttributes: Fix Builder.setFlags()

AudioAttributes.Builder.setFlags() is a public method and should only
allow to set public flags

Test: CTS AudioAttributesTest
Change-Id: Ib75e3487f5297f6a200ffe326c53a0f58458b51f
This commit is contained in:
Eric Laurent
2019-11-06 11:47:22 -08:00
parent 34fc421d5f
commit d0c49687cd

View File

@@ -710,7 +710,7 @@ public final class AudioAttributes implements Parcelable {
* @return the same Builder instance.
*/
public Builder setFlags(int flags) {
flags &= AudioAttributes.FLAG_ALL;
flags &= AudioAttributes.FLAG_ALL_PUBLIC;
mFlags |= flags;
return this;
}