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

Commit 9029d1c3 authored by Hall Liu's avatar Hall Liu
Browse files

Only play end-of-call tone for certain call terminations

Only play tone when call was previously active, dialing, or on hold.

Change-Id: I30a6ea26e0cdab00fb3dc56a294d046d9ad51c9e
Fix: 30118025
parent 61680823
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public class CallAudioManager extends CallsManagerListenerBase {
        }

        updateForegroundCall();
        if (newState == CallState.DISCONNECTED) {
        if (shouldPlayDisconnectTone(oldState, newState)) {
            playToneForDisconnectedCall(call);
        }

@@ -732,6 +732,15 @@ public class CallAudioManager extends CallsManagerListenerBase {
        }
    }

    private boolean shouldPlayDisconnectTone(int oldState, int newState) {
        if (newState != CallState.DISCONNECTED) {
            return false;
        }
        return oldState == CallState.ACTIVE ||
                oldState == CallState.DIALING ||
                oldState == CallState.ON_HOLD;
    }

    @VisibleForTesting
    public Set<Call> getTrackedCalls() {
        return mCalls;