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

Commit d8aaf45d authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioAttributes: IAE for illegal usage / content type values.

Throw an IllegalArgumentException when trying to configure an
AudioAttributes instance with invalid usage or content type values.

Test: atest AudioAttributesTest
Change-Id: If674ed2b4208fe0c5b7f69a03fcd19b61e7653bf
parent 779c5cc0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -670,7 +670,7 @@ public final class AudioAttributes implements Parcelable {
                    mUsage = usage;
                    break;
                default:
                    mUsage = USAGE_UNKNOWN;
                    throw new IllegalArgumentException("Invalid usage " + usage);
            }
            return this;
        }
@@ -696,7 +696,7 @@ public final class AudioAttributes implements Parcelable {
                    mContentType = contentType;
                    break;
                default:
                    mContentType = CONTENT_TYPE_UNKNOWN;
                    throw new IllegalArgumentException("Invalid content type " + contentType);
            }
            return this;
        }