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

Commit a3eec79e authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by Gerrit Code Review
Browse files

Merge "Hide Bluetooth codec classes constructors"

parents 2853521c d3c62fdc
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -412,7 +412,6 @@ package android.bluetooth {
  }
  }


  public final class BluetoothCodecConfig implements android.os.Parcelable {
  public final class BluetoothCodecConfig implements android.os.Parcelable {
    ctor public BluetoothCodecConfig(int);
    method public int describeContents();
    method public int describeContents();
    method public int getBitsPerSample();
    method public int getBitsPerSample();
    method public int getChannelMode();
    method public int getChannelMode();
@@ -466,7 +465,6 @@ package android.bluetooth {
  }
  }


  public final class BluetoothCodecStatus implements android.os.Parcelable {
  public final class BluetoothCodecStatus implements android.os.Parcelable {
    ctor public BluetoothCodecStatus(@Nullable android.bluetooth.BluetoothCodecConfig, @Nullable java.util.List<android.bluetooth.BluetoothCodecConfig>, @Nullable java.util.List<android.bluetooth.BluetoothCodecConfig>);
    method public int describeContents();
    method public int describeContents();
    method @Nullable public android.bluetooth.BluetoothCodecConfig getCodecConfig();
    method @Nullable public android.bluetooth.BluetoothCodecConfig getCodecConfig();
    method @NonNull public java.util.List<android.bluetooth.BluetoothCodecConfig> getCodecsLocalCapabilities();
    method @NonNull public java.util.List<android.bluetooth.BluetoothCodecConfig> getCodecsLocalCapabilities();
@@ -477,6 +475,14 @@ package android.bluetooth {
    field public static final String EXTRA_CODEC_STATUS = "android.bluetooth.extra.CODEC_STATUS";
    field public static final String EXTRA_CODEC_STATUS = "android.bluetooth.extra.CODEC_STATUS";
  }
  }


  public static final class BluetoothCodecStatus.Builder {
    ctor public BluetoothCodecStatus.Builder();
    method @NonNull public android.bluetooth.BluetoothCodecStatus build();
    method @NonNull public android.bluetooth.BluetoothCodecStatus.Builder setCodecConfig(@NonNull android.bluetooth.BluetoothCodecConfig);
    method @NonNull public android.bluetooth.BluetoothCodecStatus.Builder setCodecsLocalCapabilities(@NonNull java.util.List<android.bluetooth.BluetoothCodecConfig>);
    method @NonNull public android.bluetooth.BluetoothCodecStatus.Builder setCodecsSelectableCapabilities(@NonNull java.util.List<android.bluetooth.BluetoothCodecConfig>);
  }

  public final class BluetoothCsipSetCoordinator implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
  public final class BluetoothCsipSetCoordinator implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method public void close();
    method protected void finalize();
    method protected void finalize();
+1 −0
Original line number Original line Diff line number Diff line
@@ -272,6 +272,7 @@ public final class BluetoothCodecConfig implements Parcelable {
     * values to 0.
     * values to 0.
     *
     *
     * @param codecType the source codec type
     * @param codecType the source codec type
     * @hide
     */
     */
    public BluetoothCodecConfig(@SourceCodecType int codecType) {
    public BluetoothCodecConfig(@SourceCodecType int codecType) {
        this(codecType, BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT,
        this(codecType, BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT,
+58 −0
Original line number Original line Diff line number Diff line
@@ -45,6 +45,11 @@ public final class BluetoothCodecStatus implements Parcelable {
    private final @Nullable List<BluetoothCodecConfig> mCodecsLocalCapabilities;
    private final @Nullable List<BluetoothCodecConfig> mCodecsLocalCapabilities;
    private final @Nullable List<BluetoothCodecConfig> mCodecsSelectableCapabilities;
    private final @Nullable List<BluetoothCodecConfig> mCodecsSelectableCapabilities;


    /**
     * Creates a new BluetoothCodecStatus.
     *
     * @hide
     */
    public BluetoothCodecStatus(@Nullable BluetoothCodecConfig codecConfig,
    public BluetoothCodecStatus(@Nullable BluetoothCodecConfig codecConfig,
            @Nullable List<BluetoothCodecConfig> codecsLocalCapabilities,
            @Nullable List<BluetoothCodecConfig> codecsLocalCapabilities,
            @Nullable List<BluetoothCodecConfig> codecsSelectableCapabilities) {
            @Nullable List<BluetoothCodecConfig> codecsSelectableCapabilities) {
@@ -205,4 +210,57 @@ public final class BluetoothCodecStatus implements Parcelable {
        return (mCodecsSelectableCapabilities == null)
        return (mCodecsSelectableCapabilities == null)
                ? Collections.emptyList() : mCodecsSelectableCapabilities;
                ? 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);
        }
    }
}
}