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

Commit 0747e71b authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Wire up in call problem tone.

Ensure the call problem tone is played for diagnostic messages.

Test: Manual test of API to ensure tone is audible.
Bug: 163085177
Change-Id: I783a81f029f52198f929b2be396d4b271ea52257
parent 70decc1a
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ public class CallDiagnosticServiceController extends CallsManagerListenerBase {

    private final String mPackageName;
    private final ContextProxy mContextProxy;
    private InCallTonePlayer.Factory mPlayerFactory;
    private String mTestPackageName;
    private CallDiagnosticServiceConnection mConnection;
    private CallDiagnosticServiceAdapter mAdapter;
@@ -243,6 +244,14 @@ public class CallDiagnosticServiceController extends CallsManagerListenerBase {
        mLock = lock;
    }

    /**
     * Sets the current {@link InCallTonePlayer.Factory} for this instance.
     * @param factory the factory.
     */
    public void setInCallTonePlayerFactory(InCallTonePlayer.Factory factory) {
        mPlayerFactory = factory;
    }

    /**
     * Handles Telecom adding new calls.  Will bind to the call diagnostic service if needed and
     * send the calls, or send to an already bound service.
@@ -510,6 +519,11 @@ public class CallDiagnosticServiceController extends CallsManagerListenerBase {
        }
        Log.i(this, "handleDisplayDiagnosticMessage: callId=%s; msg=%d/%s; invalid call",
                callId, messageId, message);
        if (mPlayerFactory != null) {
            // Play that tone!
            mPlayerFactory.createPlayer(InCallTonePlayer.TONE_IN_CALL_QUALITY_NOTIFICATION)
                    .startTone();
        }
        call.displayDiagnosticMessage(messageId, message);
    }

+1 −0
Original line number Diff line number Diff line
@@ -547,6 +547,7 @@ public class CallsManager extends Call.ListenerBase
                systemStateHelper, defaultDialerCache, mTimeoutsAdapter,
                emergencyCallHelper);
        mCallDiagnosticServiceController = callDiagnosticServiceController;
        mCallDiagnosticServiceController.setInCallTonePlayerFactory(playerFactory);
        mRinger = new Ringer(playerFactory, context, systemSettingsUtil, asyncRingtonePlayer,
                ringtoneFactory, systemVibrator,
                new Ringer.VibrationEffectProxy(), mInCallController);