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

Commit 3ee5945d authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Add RTT request/response logs to Telecom dumpsys.

These are only in the logcat right now.  Also adding calling package to
the InCallAdapter calls related to RTT.

Test: Manual test to see logs
Bug: 270651896
Change-Id: I83f8bfad1b1f0bfba6405f35d1257afe40cf8807
parent 065ebfb9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3655,6 +3655,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        if (mTransactionalService != null) {
            Log.i(this, "stopRtt: called on TransactionalService. doing nothing");
        } else if (mConnectionService != null) {
            Log.addEvent(this, LogUtils.Events.REQUEST_RTT, "stop");
            mConnectionService.stopRtt(this);
        } else {
            // If this gets called by the in-call app before the connection service is set, we'll
@@ -3668,6 +3669,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            Log.i(this, "sendRttRequest: called on TransactionalService. doing nothing");
            return;
        }
        Log.addEvent(this, LogUtils.Events.REQUEST_RTT, "start");
        createRttStreams();
        mConnectionService.startRtt(this, getInCallToCsRttPipeForCs(), getCsToInCallRttPipeForCs());
    }
@@ -3691,12 +3693,14 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,

    public void onRttConnectionFailure(int reason) {
        Log.i(this, "Got RTT initiation failure with reason %d", reason);
        Log.addEvent(this, LogUtils.Events.ON_RTT_FAILED, "reason="  + reason);
        for (Listener l : mListeners) {
            l.onRttInitiationFailure(this, reason);
        }
    }

    public void onRemoteRttRequest() {
        Log.addEvent(this, LogUtils.Events.ON_RTT_REQUEST);
        if (isRttCall()) {
            Log.w(this, "Remote RTT request on a call that's already RTT");
            return;
@@ -3721,6 +3725,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            Log.i(this, "handleRttRequestResponse: called on TransactionalService. doing nothing");
            return;
        }
        Log.addEvent(this, LogUtils.Events.RESPOND_TO_RTT_REQUEST, "id=" + id + ", accept="
                + accept);
        if (accept) {
            createRttStreams();
            Log.i(this, "RTT request %d accepted.", id);
@@ -3997,7 +4003,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,

    public void setRttMode(int mode) {
        mRttMode = mode;
        // TODO: hook this up to CallAudioManager
        Log.addEvent(this, LogUtils.Events.SET_RRT_MODE, "mode=" + mode);
        // TODO: hook this up to CallAudioManager.
    }

    /**
+10 −5
Original line number Diff line number Diff line
@@ -695,7 +695,7 @@ class InCallAdapter extends IInCallAdapter.Stub {
    @Override
    public void sendRttRequest(String callId) {
        try {
            Log.startSession("ICA.sRR");
            Log.startSession("ICA.sRR", mOwnerPackageAbbreviation);
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
@@ -717,7 +717,7 @@ class InCallAdapter extends IInCallAdapter.Stub {
    @Override
    public void respondToRttRequest(String callId, int id, boolean accept) {
        try {
            Log.startSession("ICA.rTRR");
            Log.startSession("ICA.rTRR", mOwnerPackageAbbreviation);
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
@@ -739,7 +739,7 @@ class InCallAdapter extends IInCallAdapter.Stub {
    @Override
    public void stopRtt(String callId) {
        try {
            Log.startSession("ICA.sRTT");
            Log.startSession("ICA.sRTT", mOwnerPackageAbbreviation);
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
@@ -761,11 +761,16 @@ class InCallAdapter extends IInCallAdapter.Stub {
    @Override
    public void setRttMode(String callId, int mode) {
        try {
            Log.startSession("ICA.sRM");
            Log.startSession("ICA.sRM", mOwnerPackageAbbreviation);
            long token = Binder.clearCallingIdentity();
            try {
                synchronized (mLock) {
                    // TODO
                    Call call = mCallIdMapper.getCall(callId);
                    if (call != null) {
                        call.setRttMode(mode);
                    } else {
                        Log.w(this, "setRttMode(): call %s not found", callId);
                    }
                }
            } finally {
                Binder.restoreCallingIdentity(token);
+5 −0
Original line number Diff line number Diff line
@@ -109,6 +109,11 @@ public class LogUtils {
        public static final String SET_SELECT_PHONE_ACCOUNT = "SET_SELECT_PHONE_ACCOUNT";
        public static final String SET_AUDIO_PROCESSING = "SET_AUDIO_PROCESSING";
        public static final String SET_SIMULATED_RINGING = "SET_SIMULATED_RINGING";
        public static final String REQUEST_RTT = "REQUEST_RTT";
        public static final String RESPOND_TO_RTT_REQUEST = "RESPOND_TO_RTT_REQUEST";
        public static final String SET_RRT_MODE = "SET_RTT_MODE";
        public static final String ON_RTT_FAILED = "ON_RTT_FAILED";
        public static final String ON_RTT_REQUEST = "ON_RTT_REQUEST";
        public static final String REQUEST_HOLD = "REQUEST_HOLD";
        public static final String REQUEST_UNHOLD = "REQUEST_UNHOLD";
        public static final String REQUEST_DISCONNECT = "REQUEST_DISCONNECT";