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

Commit 67fd9abc authored by Grzegorz Kolodziejczyk's avatar Grzegorz Kolodziejczyk Committed by Automerger Merge Worker
Browse files

Merge "tbs: Close Call Control Proxy on In Call Service clear" am: 4cdba74c

parents f1a38f0c 4cdba74c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ package com.android.bluetooth.tbs;

import android.bluetooth.BluetoothLeCall;
import android.bluetooth.BluetoothLeCallControl;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.content.Context;

import java.util.List;
import java.util.UUID;
@@ -49,6 +52,15 @@ public class BluetoothLeCallControlProxy {
        mBluetoothLeCallControl = tbs;
    }

    public void closeBluetoothLeCallControlProxy(Context context) {
        final BluetoothManager btManager =
                context.getSystemService(BluetoothManager.class);
        if (btManager != null) {
            btManager.getAdapter().closeProfileProxy(BluetoothProfile.LE_CALL_CONTROL,
                    mBluetoothLeCallControl);
        }
    }

    public boolean registerBearer(String uci, List<String> uriSchemes, int featureFlags,
            String provider, int technology, Executor executor, BluetoothLeCallControl.Callback callback) {
        return mBluetoothLeCallControl.registerBearer(uci, uriSchemes, featureFlags, provider, technology,
+4 −2
Original line number Diff line number Diff line
@@ -154,7 +154,8 @@ public class BluetoothInCallService extends InCallService {
                            setBluetoothHeadset(new BluetoothHeadsetProxy((BluetoothHeadset) proxy));
                            updateHeadsetWithCallState(true /* force */);
                        } else {
                           setBluetoothLeCallControl(new BluetoothLeCallControlProxy((BluetoothLeCallControl) proxy));
                            setBluetoothLeCallControl(new BluetoothLeCallControlProxy((
                                    BluetoothLeCallControl) proxy));
                            sendTbsCurrentCallsList();
                        }
                    }
@@ -687,6 +688,7 @@ public class BluetoothInCallService extends InCallService {
        }
        if (mBluetoothLeCallControl != null) {
            mBluetoothLeCallControl.unregisterBearer();
            mBluetoothLeCallControl.closeBluetoothLeCallControlProxy(this);
        }
        mProfileListener = null;
        sInstance = null;