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

Commit c928e2e4 authored by Hall Liu's avatar Hall Liu Committed by Android (Google) Code Review
Browse files

Merge "Only play end-of-call tone for certain call terminations" into nyc-mr1-dev

parents b7be9e20 9029d1c3
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;