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

Commit 46fd70f5 authored by David Duarte's avatar David Duarte Committed by Automerger Merge Worker
Browse files

Merge "Revert "Revert "Remove CSIP/VCP enable/disable from Setting""" into...

Merge "Revert "Revert "Remove CSIP/VCP enable/disable from Setting""" into udc-dev am: 2920cad6 am: 889aa2cd

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23105176



Change-Id: I1d93f62feac935c10dea88d01a16170dbae1013a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f1e3e468 889aa2cd
Loading
Loading
Loading
Loading
+2 −18
Original line number Diff line number Diff line
@@ -319,7 +319,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
    }

    /**
     * Disable the Le Audio profile, VCP, and CSIP for each of the Le Audio devices.
     * Disable the Le Audio profile for each of the Le Audio devices.
     *
     * @param profile the LeAudio profile
     */
@@ -328,20 +328,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
            Log.e(TAG, "There is no the LE profile or no device in mProfileDeviceMap. Do nothing.");
            return;
        }
        LocalBluetoothProfile vcp = mProfileManager.getVolumeControlProfile();
        LocalBluetoothProfile csip = mProfileManager.getCsipSetCoordinatorProfile();

        for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) {
            Log.d(TAG,
                    "device:" + leAudioDevice.getDevice().getAnonymizedAddress()
                            + "disable LE profile");
            profile.setEnabled(leAudioDevice.getDevice(), false);
            if (vcp != null) {
                vcp.setEnabled(leAudioDevice.getDevice(), false);
            }
            if (csip != null) {
                csip.setEnabled(leAudioDevice.getDevice(), false);
            }
        }

        if (!SystemProperties.getBoolean(ENABLE_DUAL_MODE_AUDIO, false)) {
@@ -352,7 +344,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
    }

    /**
     * Enable the Le Audio profile, VCP, and CSIP for each of the Le Audio devices.
     * Enable the Le Audio profile for each of the Le Audio devices.
     *
     * @param profile the LeAudio profile
     */
@@ -368,19 +360,11 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
            disableProfileBeforeUserEnablesLeAudio(mProfileManager.getHeadsetProfile());
        }

        LocalBluetoothProfile vcp = mProfileManager.getVolumeControlProfile();
        LocalBluetoothProfile csip = mProfileManager.getCsipSetCoordinatorProfile();
        for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) {
            Log.d(TAG,
                    "device:" + leAudioDevice.getDevice().getAnonymizedAddress()
                            + "enable LE profile");
            profile.setEnabled(leAudioDevice.getDevice(), true);
            if (vcp != null) {
                vcp.setEnabled(leAudioDevice.getDevice(), true);
            }
            if (csip != null) {
                csip.setEnabled(leAudioDevice.getDevice(), true);
            }
        }
    }