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

Commit df394f76 authored by Alice Kuo's avatar Alice Kuo
Browse files

Add the connection state change handle for the volume control profile

Volume control profile broadcast the connection state change only for the connected when the bluetooth service get connected with connected VCP device. The other connection state didn't be handled. In some case, it would causes the system ui or setting got the vcp profile connected and then no further update for the real connection state. The patch add the VCP profile connection state handle that is the same as the other profile.

Bug: 278982782
Bug: 279126500
Test: connect/disconnect and check the connection state change would
update

Change-Id: Ia94151456611a4bbe7d7291bb9c4931764b62b9b
parent f91a331f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.bluetooth.BluetoothPbapClient;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothSap;
import android.bluetooth.BluetoothUuid;
import android.bluetooth.BluetoothVolumeControl;
import android.content.Context;
import android.content.Intent;
import android.os.ParcelUuid;
@@ -240,8 +241,8 @@ public class LocalBluetoothProfileManager {
                Log.d(TAG, "Adding local Volume Control profile");
            }
            mVolumeControlProfile = new VolumeControlProfile(mContext, mDeviceManager, this);
            // Note: no event handler for VCP, only for being connectable.
            mProfileNameMap.put(VolumeControlProfile.NAME, mVolumeControlProfile);
            addProfile(mVolumeControlProfile, VolumeControlProfile.NAME,
                    BluetoothVolumeControl.ACTION_CONNECTION_STATE_CHANGED);
        }
        if (mLeAudioProfile == null && supportedList.contains(BluetoothProfile.LE_AUDIO)) {
            if (DEBUG) {