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

Commit c3ea0783 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Fix issue where InCallTonePlayer could fail to stop ringback.

The issue was that the code for stop tone was checking the mState.
Realistically that's what the latch was supposed to be for, so we don't
need to check the state.

Test: Manual test; reproduced using test app; verified that applied fix removed concurrency issue.
Fixes: 229765709
Change-Id: Ie8406c2a7010bbc48b9b269b1b6d266a08d9ab8a
parent 026d702d
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -510,11 +510,10 @@ public class InCallTonePlayer extends Thread {
     */
    @VisibleForTesting
    public void stopTone() {
        if (mState == STATE_ON) {
        Log.i(this, "stopTone: Stopping the tone %d.", mToneId);
        // Notify the playback to end early.
        mPlaybackLatch.countDown();
        }

        mState = STATE_STOPPED;
    }