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

Commit 4731d9e3 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Wire up in call problem tone." into sc-dev

parents 70a6466c 0747e71b
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);