Loading android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientConnection.java +10 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class HfpClientConnection extends Connection { private BluetoothHeadsetClient mHeadsetProfile; private BluetoothHeadsetClientCall mCurrentCall; private int mPreviousCallState = -1; private boolean mClosed; private boolean mClosing = false; private boolean mLocalDisconnect; Loading Loading @@ -162,12 +163,19 @@ public class HfpClientConnection extends Connection { setRinging(); break; case BluetoothHeadsetClientCall.CALL_STATE_TERMINATED: // TODO Use more specific causes close(mLocalDisconnect ? DisconnectCause.LOCAL : DisconnectCause.REMOTE); if (mPreviousCallState == BluetoothHeadsetClientCall.CALL_STATE_INCOMING || mPreviousCallState == BluetoothHeadsetClientCall.CALL_STATE_WAITING) { close(DisconnectCause.MISSED); } else if (mLocalDisconnect) { close(DisconnectCause.LOCAL); } else { close(DisconnectCause.REMOTE); } break; default: Log.wtf(TAG, "Unexpected phone state " + state); } mPreviousCallState = state; } public synchronized void close(int cause) { Loading android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientDeviceBlock.java +5 −5 Original line number Diff line number Diff line Loading @@ -192,15 +192,15 @@ public class HfpClientDeviceBlock { // (represented as unknown call in telecom since). Since BluetoothHeadsetClientCall is a // parcelable we simply pack the entire object in there. Bundle b = new Bundle(); if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_DIALING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ALERTING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ACTIVE || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_WAITING) { if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_DIALING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ALERTING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ACTIVE) { // This is an outgoing call. Even if it is an active call we do not have a way of // putting that parcelable in a seaprate field. b.putParcelable(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, call); mTelecomManager.addNewUnknownCall(mPhoneAccount.getAccountHandle(), b); } else if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_INCOMING) { } else if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_INCOMING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_WAITING) { // This is an incoming call. b.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_EXTRAS, call); mTelecomManager.addNewIncomingCall(mPhoneAccount.getAccountHandle(), b); Loading Loading
android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientConnection.java +10 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class HfpClientConnection extends Connection { private BluetoothHeadsetClient mHeadsetProfile; private BluetoothHeadsetClientCall mCurrentCall; private int mPreviousCallState = -1; private boolean mClosed; private boolean mClosing = false; private boolean mLocalDisconnect; Loading Loading @@ -162,12 +163,19 @@ public class HfpClientConnection extends Connection { setRinging(); break; case BluetoothHeadsetClientCall.CALL_STATE_TERMINATED: // TODO Use more specific causes close(mLocalDisconnect ? DisconnectCause.LOCAL : DisconnectCause.REMOTE); if (mPreviousCallState == BluetoothHeadsetClientCall.CALL_STATE_INCOMING || mPreviousCallState == BluetoothHeadsetClientCall.CALL_STATE_WAITING) { close(DisconnectCause.MISSED); } else if (mLocalDisconnect) { close(DisconnectCause.LOCAL); } else { close(DisconnectCause.REMOTE); } break; default: Log.wtf(TAG, "Unexpected phone state " + state); } mPreviousCallState = state; } public synchronized void close(int cause) { Loading
android/app/src/com/android/bluetooth/hfpclient/connserv/HfpClientDeviceBlock.java +5 −5 Original line number Diff line number Diff line Loading @@ -192,15 +192,15 @@ public class HfpClientDeviceBlock { // (represented as unknown call in telecom since). Since BluetoothHeadsetClientCall is a // parcelable we simply pack the entire object in there. Bundle b = new Bundle(); if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_DIALING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ALERTING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ACTIVE || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_WAITING) { if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_DIALING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ALERTING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_ACTIVE) { // This is an outgoing call. Even if it is an active call we do not have a way of // putting that parcelable in a seaprate field. b.putParcelable(TelecomManager.EXTRA_OUTGOING_CALL_EXTRAS, call); mTelecomManager.addNewUnknownCall(mPhoneAccount.getAccountHandle(), b); } else if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_INCOMING) { } else if (call.getState() == BluetoothHeadsetClientCall.CALL_STATE_INCOMING || call.getState() == BluetoothHeadsetClientCall.CALL_STATE_WAITING) { // This is an incoming call. b.putParcelable(TelecomManager.EXTRA_INCOMING_CALL_EXTRAS, call); mTelecomManager.addNewIncomingCall(mPhoneAccount.getAccountHandle(), b); Loading