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

Commit d6906d2e authored by Sanket Agarwal's avatar Sanket Agarwal Committed by android-build-merger
Browse files

Merge "Handle conference calling w/ multi device" am: 163cea98 am: 710dd213

am: b8c09353

Change-Id: Ic2b7962fdae2048ae311007d7ea534d615afd884
parents 55c4b996 b8c09353
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -189,6 +189,10 @@ public class HfpClientConnection extends Connection {
        return mClosing;
    }

    public synchronized BluetoothDevice getDevice() {
        return mDevice;
    }

    @Override
    public synchronized void onPlayDtmfTone(char c) {
        if (DBG) {
+13 −10
Original line number Diff line number Diff line
@@ -46,11 +46,12 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;

public class HfpClientConnectionService extends ConnectionService {
    private static final String TAG = "HfpClientConnService";
    private static final boolean DBG = false;
    private static final boolean DBG = true;

    public static final String HFP_SCHEME = "hfpc";

@@ -251,16 +252,18 @@ public class HfpClientConnectionService extends ConnectionService {
            Log.d(TAG, "onConference " + connection1 + " " + connection2);
        }

        // TODO: Fix conference calling
        BluetoothDevice bd1 = ((HfpClientConnection) connection1).getDevice();
        BluetoothDevice bd2 = ((HfpClientConnection) connection2).getDevice();
        // We can only conference two connections on same device
        // if (!connection1.getCall().getDevice().equals(connection2.getCall().getDevice())) {
        //     Log.e(TAG, "Cannot conference calls from two different devices " +
        //         "conn1 " + connection1 + " conn2 " + connection2);
        //     return;
        // }

        // HfpClientDeviceBlock block = findBlockForDevice(connection1.getCall().getDevice());
        // block.onConference(connection1, connection2);
        if (!Objects.equals(bd1, bd2)) {
            Log.e(TAG, "Cannot conference calls from two different devices "
                            + "bd1 " + bd1 + " bd2 " + bd2 + " conn1 " + connection1
                            + "connection2 " + connection2);
            return;
        }

        HfpClientDeviceBlock block = findBlockForDevice(bd1);
        block.onConference(connection1, connection2);
    }

    private BluetoothDevice getDevice(PhoneAccountHandle handle) {