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

Commit 9aa85e64 authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by Automerger Merge Worker
Browse files

Merge "Check sysprop value before trying to bind to service" into tm-dev am:...

Merge "Check sysprop value before trying to bind to service" into tm-dev am: 2db83e5c am: 2b2e435b

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/18963721



Change-Id: I7afb6e9ffe7046c0b085d2d0a304eb954abd5ac4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bafd14f9 2b2e435b
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -1446,21 +1446,21 @@ public class BluetoothManagerService extends IBluetoothManager.Stub {
        }
        synchronized (mProfileServices) {
            ProfileServiceConnections psc = mProfileServices.get(new Integer(bluetoothProfile));
            if (psc == null) {
                if (DBG) {
                    Log.d(TAG, "Creating new ProfileServiceConnections object for" + " profile: "
                            + bluetoothProfile);
                }

            Intent intent;
                if (bluetoothProfile == BluetoothProfile.HEADSET) {
            if (bluetoothProfile == BluetoothProfile.HEADSET
                    && BluetoothProperties.isProfileHfpAgEnabled().orElse(false)) {
                intent = new Intent(IBluetoothHeadset.class.getName());
                } else if (bluetoothProfile== BluetoothProfile.LE_CALL_CONTROL) {
            } else if (bluetoothProfile == BluetoothProfile.LE_CALL_CONTROL
                    && BluetoothProperties.isProfileCcpServerEnabled().orElse(false)) {
                intent = new Intent(IBluetoothLeCallControl.class.getName());
            } else {
                return false;
            }

            if (psc == null) {
                if (DBG) {
                    Log.d(TAG, "Creating new ProfileServiceConnections object for" + " profile: "
                            + bluetoothProfile);
                }
                psc = new ProfileServiceConnections(intent);
                if (!psc.bindService(DEFAULT_REBIND_COUNT)) {
                    return false;