Loading android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientConnection.java +12 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public class HfpClientConnection extends Connection { private final Context mContext; private final BluetoothDevice mDevice; private BluetoothHeadsetClient mHeadsetProfile; private HfpClientConnectionService mHfpClientConnectionService; private BluetoothHeadsetClientCall mCurrentCall; private int mPreviousCallState = -1; Loading Loading @@ -244,7 +245,7 @@ public class HfpClientConnection extends Connection { @Override public synchronized void onUnhold() { if (getConnectionService().getAllConnections().size() > 1) { if (getHfpClientConnectionService().getAllConnections().size() > 1) { Log.w(TAG, "Ignoring unhold; call hold on the foreground call"); return; } Loading Loading @@ -290,4 +291,14 @@ public class HfpClientConnection extends Connection { return "HfpClientConnection{" + getAddress() + "," + stateToString(getState()) + "," + mCurrentCall + "}"; } public void setHfpClientConnectionService( HfpClientConnectionService hfpClientConnectionService) { mHfpClientConnectionService = hfpClientConnectionService; } public HfpClientConnectionService getHfpClientConnectionService() { return mHfpClientConnectionService; } } android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientConnectionService.java +9 −4 Original line number Diff line number Diff line Loading @@ -196,7 +196,9 @@ public class HfpClientConnectionService extends ConnectionService { // We should already have a connection by this time. BluetoothHeadsetClientCall call = request.getExtras().getParcelable(TelecomManager.EXTRA_INCOMING_CALL_EXTRAS); return block.onCreateIncomingConnection(call); HfpClientConnection connection = block.onCreateIncomingConnection(call); connection.setHfpClientConnectionService(this); return connection; } // This method is called *only if* Dialer UI is used to place an outgoing call. Loading @@ -211,8 +213,9 @@ public class HfpClientConnectionService extends ConnectionService { Log.w(TAG, "HfpClient does not support having a connection manager"); return null; } return block.onCreateOutgoingConnection(request.getAddress()); HfpClientConnection connection = block.onCreateOutgoingConnection(request.getAddress()); connection.setHfpClientConnectionService(this); return connection; } // This method is called when: Loading @@ -233,7 +236,9 @@ public class HfpClientConnectionService extends ConnectionService { // We should already have a connection by this time. BluetoothHeadsetClientCall call = request.getExtras().getParcelable(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS); return block.onCreateUnknownConnection(call); HfpClientConnection connection = block.onCreateUnknownConnection(call); connection.setHfpClientConnectionService(this); return connection; } @Override Loading android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientDeviceBlock.java +3 −3 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class HfpClientDeviceBlock { } } synchronized Connection onCreateIncomingConnection(BluetoothHeadsetClientCall call) { synchronized HfpClientConnection onCreateIncomingConnection(BluetoothHeadsetClientCall call) { HfpClientConnection connection = mConnections.get(call.getUUID()); if (connection != null) { connection.onAdded(); Loading @@ -98,7 +98,7 @@ public class HfpClientDeviceBlock { } } Connection onCreateOutgoingConnection(Uri address) { HfpClientConnection onCreateOutgoingConnection(Uri address) { HfpClientConnection connection = buildConnection(null, address); if (connection != null) { connection.onAdded(); Loading @@ -106,7 +106,7 @@ public class HfpClientDeviceBlock { return connection; } synchronized Connection onCreateUnknownConnection(BluetoothHeadsetClientCall call) { synchronized HfpClientConnection onCreateUnknownConnection(BluetoothHeadsetClientCall call) { Uri number = Uri.fromParts(PhoneAccount.SCHEME_TEL, call.getNumber(), null); HfpClientConnection connection = mConnections.get(call.getUUID()); Loading Loading
android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientConnection.java +12 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ public class HfpClientConnection extends Connection { private final Context mContext; private final BluetoothDevice mDevice; private BluetoothHeadsetClient mHeadsetProfile; private HfpClientConnectionService mHfpClientConnectionService; private BluetoothHeadsetClientCall mCurrentCall; private int mPreviousCallState = -1; Loading Loading @@ -244,7 +245,7 @@ public class HfpClientConnection extends Connection { @Override public synchronized void onUnhold() { if (getConnectionService().getAllConnections().size() > 1) { if (getHfpClientConnectionService().getAllConnections().size() > 1) { Log.w(TAG, "Ignoring unhold; call hold on the foreground call"); return; } Loading Loading @@ -290,4 +291,14 @@ public class HfpClientConnection extends Connection { return "HfpClientConnection{" + getAddress() + "," + stateToString(getState()) + "," + mCurrentCall + "}"; } public void setHfpClientConnectionService( HfpClientConnectionService hfpClientConnectionService) { mHfpClientConnectionService = hfpClientConnectionService; } public HfpClientConnectionService getHfpClientConnectionService() { return mHfpClientConnectionService; } }
android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientConnectionService.java +9 −4 Original line number Diff line number Diff line Loading @@ -196,7 +196,9 @@ public class HfpClientConnectionService extends ConnectionService { // We should already have a connection by this time. BluetoothHeadsetClientCall call = request.getExtras().getParcelable(TelecomManager.EXTRA_INCOMING_CALL_EXTRAS); return block.onCreateIncomingConnection(call); HfpClientConnection connection = block.onCreateIncomingConnection(call); connection.setHfpClientConnectionService(this); return connection; } // This method is called *only if* Dialer UI is used to place an outgoing call. Loading @@ -211,8 +213,9 @@ public class HfpClientConnectionService extends ConnectionService { Log.w(TAG, "HfpClient does not support having a connection manager"); return null; } return block.onCreateOutgoingConnection(request.getAddress()); HfpClientConnection connection = block.onCreateOutgoingConnection(request.getAddress()); connection.setHfpClientConnectionService(this); return connection; } // This method is called when: Loading @@ -233,7 +236,9 @@ public class HfpClientConnectionService extends ConnectionService { // We should already have a connection by this time. BluetoothHeadsetClientCall call = request.getExtras().getParcelable(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS); return block.onCreateUnknownConnection(call); HfpClientConnection connection = block.onCreateUnknownConnection(call); connection.setHfpClientConnectionService(this); return connection; } @Override Loading
android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientDeviceBlock.java +3 −3 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public class HfpClientDeviceBlock { } } synchronized Connection onCreateIncomingConnection(BluetoothHeadsetClientCall call) { synchronized HfpClientConnection onCreateIncomingConnection(BluetoothHeadsetClientCall call) { HfpClientConnection connection = mConnections.get(call.getUUID()); if (connection != null) { connection.onAdded(); Loading @@ -98,7 +98,7 @@ public class HfpClientDeviceBlock { } } Connection onCreateOutgoingConnection(Uri address) { HfpClientConnection onCreateOutgoingConnection(Uri address) { HfpClientConnection connection = buildConnection(null, address); if (connection != null) { connection.onAdded(); Loading @@ -106,7 +106,7 @@ public class HfpClientDeviceBlock { return connection; } synchronized Connection onCreateUnknownConnection(BluetoothHeadsetClientCall call) { synchronized HfpClientConnection onCreateUnknownConnection(BluetoothHeadsetClientCall call) { Uri number = Uri.fromParts(PhoneAccount.SCHEME_TEL, call.getNumber(), null); HfpClientConnection connection = mConnections.get(call.getUUID()); Loading