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

Commit 7d12e69a authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "AudioDeviceBroker in audio service"

parents a0854bdd dfd389ca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -434,7 +434,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
     * {@inheritDoc}
     */
    @Override
    public int getConnectionState(BluetoothDevice device) {
    public @BtProfileState int getConnectionState(BluetoothDevice device) {
        if (VDBG) log("getState(" + device + ")");
        try {
            mServiceLock.readLock().lock();
@@ -689,7 +689,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
     * @hide
     */
    @UnsupportedAppUsage
    public BluetoothCodecStatus getCodecStatus(BluetoothDevice device) {
    public @Nullable BluetoothCodecStatus getCodecStatus(BluetoothDevice device) {
        if (DBG) Log.d(TAG, "getCodecStatus(" + device + ")");
        try {
            mServiceLock.readLock().lock();
+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.bluetooth;

import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;
@@ -42,7 +43,7 @@ public final class BluetoothCodecStatus implements Parcelable {
    public static final String EXTRA_CODEC_STATUS =
            "android.bluetooth.codec.extra.CODEC_STATUS";

    private final BluetoothCodecConfig mCodecConfig;
    private final @Nullable BluetoothCodecConfig mCodecConfig;
    private final BluetoothCodecConfig[] mCodecsLocalCapabilities;
    private final BluetoothCodecConfig[] mCodecsSelectableCapabilities;

@@ -140,7 +141,7 @@ public final class BluetoothCodecStatus implements Parcelable {
     * @return the current codec configuration
     */
    @UnsupportedAppUsage
    public BluetoothCodecConfig getCodecConfig() {
    public @Nullable BluetoothCodecConfig getCodecConfig() {
        return mCodecConfig;
    }

+13 −0
Original line number Diff line number Diff line
@@ -18,11 +18,14 @@
package android.bluetooth;

import android.Manifest;
import android.annotation.IntDef;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Build;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;

/**
@@ -60,6 +63,16 @@ public interface BluetoothProfile {
    /** The profile is in disconnecting state */
    int STATE_DISCONNECTING = 3;

    /** @hide */
    @IntDef({
            STATE_DISCONNECTED,
            STATE_CONNECTING,
            STATE_CONNECTED,
            STATE_DISCONNECTING,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface BtProfileState {}

    /**
     * Headset and Handsfree profile
     */