summaryrefslogtreecommitdiff
path: root/framework/java
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2022-03-09 10:24:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-03-09 10:24:16 +0000
commita3eec79eedff2e67a7acda207ae48c688ca672e0 (patch)
tree9dc756d1d5464ba6beb0ad8f66f60ef331e5fb94 /framework/java
parent2853521cb226a38a1a2f62323c2af0bb8f8f2dc2 (diff)
parentd3c62fdc1247a02431a28cca0f547fa94c388dfa (diff)
Merge "Hide Bluetooth codec classes constructors"
Diffstat (limited to 'framework/java')
-rw-r--r--framework/java/android/bluetooth/BluetoothCodecConfig.java1
-rw-r--r--framework/java/android/bluetooth/BluetoothCodecStatus.java58
2 files changed, 59 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothCodecConfig.java b/framework/java/android/bluetooth/BluetoothCodecConfig.java
index 91e234aaaf..b7609c5d64 100644
--- a/framework/java/android/bluetooth/BluetoothCodecConfig.java
+++ b/framework/java/android/bluetooth/BluetoothCodecConfig.java
@@ -272,6 +272,7 @@ public final class BluetoothCodecConfig implements Parcelable {
* values to 0.
*
* @param codecType the source codec type
+ * @hide
*/
public BluetoothCodecConfig(@SourceCodecType int codecType) {
this(codecType, BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT,
diff --git a/framework/java/android/bluetooth/BluetoothCodecStatus.java b/framework/java/android/bluetooth/BluetoothCodecStatus.java
index 02606feb3b..6884a3ce93 100644
--- a/framework/java/android/bluetooth/BluetoothCodecStatus.java
+++ b/framework/java/android/bluetooth/BluetoothCodecStatus.java
@@ -45,6 +45,11 @@ public final class BluetoothCodecStatus implements Parcelable {
private final @Nullable List<BluetoothCodecConfig> mCodecsLocalCapabilities;
private final @Nullable List<BluetoothCodecConfig> mCodecsSelectableCapabilities;
+ /**
+ * Creates a new BluetoothCodecStatus.
+ *
+ * @hide
+ */
public BluetoothCodecStatus(@Nullable BluetoothCodecConfig codecConfig,
@Nullable List<BluetoothCodecConfig> codecsLocalCapabilities,
@Nullable List<BluetoothCodecConfig> codecsSelectableCapabilities) {
@@ -205,4 +210,57 @@ public final class BluetoothCodecStatus implements Parcelable {
return (mCodecsSelectableCapabilities == null)
? Collections.emptyList() : mCodecsSelectableCapabilities;
}
+
+ /**
+ * Builder for {@link BluetoothCodecStatus}.
+ */
+ public static final class Builder {
+ private BluetoothCodecConfig mCodecConfig = null;
+ private List<BluetoothCodecConfig> mCodecsLocalCapabilities = null;
+ private List<BluetoothCodecConfig> mCodecsSelectableCapabilities = null;
+
+ /**
+ * Set Bluetooth codec config for this codec status.
+ *
+ * @param codecConfig of this codec status
+ * @return the same Builder instance
+ */
+ public @NonNull Builder setCodecConfig(@NonNull BluetoothCodecConfig codecConfig) {
+ mCodecConfig = codecConfig;
+ return this;
+ }
+
+ /**
+ * Set codec local capabilities list for this codec status.
+ *
+ * @param codecsLocalCapabilities of this codec status
+ * @return the same Builder instance
+ */
+ public @NonNull Builder setCodecsLocalCapabilities(
+ @NonNull List<BluetoothCodecConfig> codecsLocalCapabilities) {
+ mCodecsLocalCapabilities = codecsLocalCapabilities;
+ return this;
+ }
+
+ /**
+ * Set codec selectable capabilities list for this codec status.
+ *
+ * @param codecsSelectableCapabilities of this codec status
+ * @return the same Builder instance
+ */
+ public @NonNull Builder setCodecsSelectableCapabilities(
+ @NonNull List<BluetoothCodecConfig> codecsSelectableCapabilities) {
+ mCodecsSelectableCapabilities = codecsSelectableCapabilities;
+ return this;
+ }
+
+ /**
+ * Build {@link BluetoothCodecStatus}.
+ * @return new BluetoothCodecStatus built
+ */
+ public @NonNull BluetoothCodecStatus build() {
+ return new BluetoothCodecStatus(mCodecConfig, mCodecsLocalCapabilities,
+ mCodecsSelectableCapabilities);
+ }
+ }
}