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

Commit 1e6feded authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix A2DP volume at 0 on connection"

parents 8dacd619 89f142b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -600,7 +600,7 @@ import java.util.ArrayList;
                    break;
                case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE:
                    mDeviceInventory.onSetA2dpSinkConnectionState(
                            (BtHelper.BluetoothA2dpDeviceInfo) msg.obj, msg.arg1, msg.arg2);
                            (BtHelper.BluetoothA2dpDeviceInfo) msg.obj, msg.arg1);
                    break;
                case MSG_IL_SET_A2DP_SOURCE_CONNECTION_STATE:
                    mDeviceInventory.onSetA2dpSourceConnectionState(
+5 −3
Original line number Diff line number Diff line
@@ -147,18 +147,20 @@ public final class AudioDeviceInventory {
    }

    /*package*/ void onSetA2dpSinkConnectionState(@NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo,
            @AudioService.BtProfileConnectionState int state, int a2dpVolume) {
            @AudioService.BtProfileConnectionState int state) {
        final BluetoothDevice btDevice = btInfo.getBtDevice();
        int a2dpVolume = btInfo.getVolume();
        if (AudioService.DEBUG_DEVICES) {
            Log.d(TAG, "onSetA2dpSinkConnectionState btDevice=" + btDevice + " state="
                    + state + " is dock=" + btDevice.isBluetoothDock());
                    + state + " is dock=" + btDevice.isBluetoothDock() + " vol=" + a2dpVolume);
        }
        String address = btDevice.getAddress();
        if (!BluetoothAdapter.checkBluetoothAddress(address)) {
            address = "";
        }
        AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent(
                "A2DP sink connected: device addr=" + address + " state=" + state));
                "A2DP sink connected: device addr=" + address + " state=" + state
                        + " vol=" + a2dpVolume));

        final int a2dpCodec;
        synchronized (mDeviceBroker.mA2dpAvrcpLock) {