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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user