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

Commit bcfbd682 authored by Santos Cordon's avatar Santos Cordon Committed by Android (Google) Code Review
Browse files

Merge "Add logging in Telecom for conference call & audio tracking." into mnc-dev

parents c03de65a 165c1ced
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1182,6 +1182,7 @@ public class Call implements CreateConnectionResponse {
        if (mConnectionService == null) {
            Log.w(this, "conference requested on a call without a connection service.");
        } else {
            Log.event(this, Log.Events.CONFERENCE_WITH, otherCall);
            mConnectionService.conference(this, otherCall);
        }
    }
@@ -1190,6 +1191,7 @@ public class Call implements CreateConnectionResponse {
        if (mConnectionService == null) {
            Log.w(this, "splitting from conference call without a connection service");
        } else {
            Log.event(this, Log.Events.SPLIT_CONFERENCE);
            mConnectionService.splitFromConference(this);
        }
    }
@@ -1198,6 +1200,7 @@ public class Call implements CreateConnectionResponse {
        if (mConnectionService == null) {
            Log.w(this, "merging conference calls without a connection service.");
        } else if (can(Connection.CAPABILITY_MERGE_CONFERENCE)) {
            Log.event(this, Log.Events.CONFERENCE_WITH);
            mConnectionService.mergeConference(this);
            mWasConferencePreviouslyMerged = true;
        }
@@ -1207,6 +1210,7 @@ public class Call implements CreateConnectionResponse {
        if (mConnectionService == null) {
            Log.w(this, "swapping conference calls without a connection service.");
        } else if (can(Connection.CAPABILITY_SWAP_CONFERENCE)) {
            Log.event(this, Log.Events.SWAP);
            mConnectionService.swapConference(this);
            switch (mChildCalls.size()) {
                case 1:
@@ -1245,6 +1249,7 @@ public class Call implements CreateConnectionResponse {
            mParentCall.addChildCall(this);
        }

        Log.event(this, Log.Events.SET_PARENT, mParentCall);
        for (Listener l : mListeners) {
            l.onParentChanged(this);
        }
@@ -1274,6 +1279,8 @@ public class Call implements CreateConnectionResponse {
            mConferenceLevelActiveCall = call;
            mChildCalls.add(call);

            Log.event(this, Log.Events.ADD_CHILD, call);

            for (Listener l : mListeners) {
                l.onChildrenChanged(this);
            }
@@ -1282,6 +1289,7 @@ public class Call implements CreateConnectionResponse {

    private void removeChildCall(Call call) {
        if (mChildCalls.remove(call)) {
            Log.event(this, Log.Events.REMOVE_CHILD, call);
            for (Listener l : mListeners) {
                l.onChildrenChanged(this);
            }
+8 −0
Original line number Diff line number Diff line
@@ -319,6 +319,11 @@ final class CallAudioManager extends CallsManagerListenerBase
        }

        if (mCallAudioState.isMuted() != shouldMute) {
            // We user CallsManager's foreground call so that we dont ignore ringing calls
            // for logging purposes
            Log.event(mCallsManager.getForegroundCall(), Log.Events.MUTE,
                    shouldMute ? "on" : "off");

            setSystemAudioState(shouldMute, mCallAudioState.getRoute(),
                    mCallAudioState.getSupportedRouteMask());
        }
@@ -440,7 +445,10 @@ final class CallAudioManager extends CallsManagerListenerBase
        if (!force && Objects.equals(oldAudioState, mCallAudioState)) {
            return;
        }

        Log.i(this, "setSystemAudioState: changing from %s to %s", oldAudioState, mCallAudioState);
        Log.event(mCallsManager.getForegroundCall(), Log.Events.AUDIO_ROUTE,
                CallAudioState.audioRouteToString(mCallAudioState.getRoute()));

        mAudioManagerHandler.obtainMessage(
                MSG_AUDIO_MANAGER_SET_MICROPHONE_MUTE,
+3 −2
Original line number Diff line number Diff line
@@ -663,6 +663,7 @@ final class ConnectionServiceWrapper extends ServiceBinder {
                            gatewayInfo.getOriginalAddress());
                }

                Log.event(call, Log.Events.START_CONNECTION, Log.piiHandle(call.getHandle()));
                try {
                    mServiceInterface.createConnection(
                            call.getConnectionManagerPhoneAccount(),
@@ -688,7 +689,7 @@ final class ConnectionServiceWrapper extends ServiceBinder {
            }
        };

        mBinder.bind(callback);
        mBinder.bind(callback, call);
    }

    /** @see IConnectionService#abort(String) */
@@ -1018,7 +1019,7 @@ final class ConnectionServiceWrapper extends ServiceBinder {
                        setRemoteServices(callback, simServiceComponentNames, simServiceBinders);
                    }
                }
            });
            }, null);
        }
    }

+0 −1
Original line number Diff line number Diff line
@@ -206,7 +206,6 @@ final class CreateConnectionProcessor {
                mCall.setConnectionService(service);
                setTimeoutIfNeeded(service, attempt);

                Log.i(this, "Attempting to call from %s", service.getComponentName());
                service.createConnection(mCall, new Response(service));
            }
        } else {
+25 −1
Original line number Diff line number Diff line
@@ -70,6 +70,17 @@ public class Log {
        public static final String STOP_RINGER = "STOP_RINGER";
        public static final String START_CALL_WAITING_TONE = "START_CALL_WAITING_TONE";
        public static final String STOP_CALL_WAITING_TONE = "STOP_CALL_WAITING_TONE";
        public static final String START_CONNECTION = "START_CONNECTION";
        public static final String BIND_CS = "BIND_CS";
        public static final String CS_BOUND = "CS_BOUND";
        public static final String CONFERENCE_WITH = "CONF_WITH";
        public static final String SPLIT_CONFERENCE = "CONF_SPLIT";
        public static final String SWAP = "SWAP";
        public static final String ADD_CHILD = "ADD_CHILD";
        public static final String REMOVE_CHILD = "REMOVE_CHILD";
        public static final String SET_PARENT = "SET_PARENT";
        public static final String MUTE = "MUTE";
        public static final String AUDIO_ROUTE = "AUDIO_ROUTE";
        public static final String ERROR_LOG = "ERROR";

        /**
@@ -85,6 +96,8 @@ public class Log {
                    put(REQUEST_DISCONNECT, SET_DISCONNECTED);
                    put(REQUEST_HOLD, SET_HOLD);
                    put(REQUEST_UNHOLD, SET_ACTIVE);
                    put(START_CONNECTION, SET_DIALING);
                    put(BIND_CS, CS_BOUND);
                }};
    }

@@ -154,7 +167,18 @@ public class Log {
                pw.print(event.eventId);
                if (event.data != null) {
                    pw.print(" (");
                    pw.print(event.data);
                    Object data = event.data;

                    if (data instanceof Call) {
                        // If the data is another call, then change the data to the call's CallEvent
                        // ID instead.
                        CallEventRecord record = mCallEventRecordMap.get(data);
                        if (record != null) {
                            data = "Call " + record.mId;
                        }
                    }

                    pw.print(data);
                    pw.print(")");
                }

Loading