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

Commit 55aef2ba authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "Set the client terminated reason as the remote headset end the call"...

Merge "Set the client terminated reason as the remote headset end the call" am: b4a88c7d am: 2ef49c7f am: 39a2a5d9 am: 847cef66

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



Change-Id: I498bcd6fc532bf5e93c60814c4f73a446e2d9cdf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 84c10ff1 847cef66
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ public class BluetoothInCallService extends InCallService {
    private BluetoothCall mOldHeldCall = null;
    private boolean mHeadsetUpdatedRecently = false;
    private boolean mIsDisconnectedTonePlaying = false;
    private boolean mIsTerminatedByClient = false;

    private static final Object LOCK = new Object();
    private BluetoothHeadsetProxy mBluetoothHeadset;
@@ -1287,6 +1288,10 @@ public class BluetoothInCallService extends InCallService {
        case DisconnectCause.REJECTED:
            return BluetoothLeCallControl.TERMINATION_REASON_REMOTE_HANGUP;
        case DisconnectCause.LOCAL:
            if (mIsTerminatedByClient) {
                mIsTerminatedByClient = false;
                return BluetoothLeCallControl.TERMINATION_REASON_CLIENT_HANGUP;
            }
            return BluetoothLeCallControl.TERMINATION_REASON_SERVER_HANGUP;
        case DisconnectCause.ERROR:
            return BluetoothLeCallControl.TERMINATION_REASON_NETWORK_CONGESTION;
@@ -1413,6 +1418,7 @@ public class BluetoothInCallService extends InCallService {
                if (mCallInfo.isNullCall(call)) {
                    result = BluetoothLeCallControl.RESULT_ERROR_UNKNOWN_CALL_ID;
                } else {
                    mIsTerminatedByClient = true;
                    call.disconnect();
                }
                mBluetoothLeCallControl.requestResult(requestId, result);