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

Commit 0d7a00a8 authored by Santos Cordon's avatar Santos Cordon
Browse files

Add more logging to Telecom for NYC-DR.

Bug: 30411195
Change-Id: I074dcfc41f96ae056153b951cd272896fc116a86
parent 54f0f937
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -1013,10 +1013,18 @@ public class Call implements CreateConnectionResponse {
                connectionCapabilities = removeVideoCapabilities(connectionCapabilities);
            }

            int previousCapabilities = mConnectionCapabilities;
            mConnectionCapabilities = connectionCapabilities;
            for (Listener l : mListeners) {
                l.onConnectionCapabilitiesChanged(this);
            }

            int xorCaps = previousCapabilities ^ mConnectionCapabilities;
            Log.event(this, Log.Events.CAPABILITY_CHANGE,
                    "Current: [%s], Removed [%s], Added [%s]",
                    Connection.capabilitiesToStringShort(mConnectionCapabilities),
                    Connection.capabilitiesToStringShort(previousCapabilities & xorCaps),
                    Connection.capabilitiesToStringShort(mConnectionCapabilities & xorCaps));
        }
    }

@@ -1043,6 +1051,13 @@ public class Call implements CreateConnectionResponse {
                }

            }

            int xorProps = previousProperties ^ mConnectionProperties;
            Log.event(this, Log.Events.PROPERTY_CHANGE,
                    "Current: [%s], Removed [%s], Added [%s]",
                    Connection.propertiesToStringShort(mConnectionProperties),
                    Connection.propertiesToStringShort(previousProperties & xorProps),
                    Connection.propertiesToStringShort(mConnectionProperties & xorProps));
        }
    }

+17 −1
Original line number Diff line number Diff line
@@ -168,6 +168,8 @@ public class Log {
        public static final String SEND_VIDEO_REQUEST = "SEND_VIDEO_REQUEST";
        public static final String SEND_VIDEO_RESPONSE = "SEND_VIDEO_RESPONSE";
        public static final String IS_EXTERNAL = "IS_EXTERNAL";
        public static final String PROPERTY_CHANGE = "PROPERTY_CHANGE";
        public static final String CAPABILITY_CHANGE = "CAPABILITY_CHANGE";

        public static class Timings {
            public static final String ACCEPT_TIMING = "accept";
@@ -373,7 +375,7 @@ public class Log {
        }
    }

    public static final int MAX_CALLS_TO_CACHE = 5;  // Arbitrarily chosen.
    public static final int MAX_CALLS_TO_CACHE = 10;  // Arbitrarily chosen.
    public static final int MAX_CALLS_TO_CACHE_DEBUG = 20;  // Arbitrarily chosen.
    private static final long EXTENDED_LOGGING_DURATION_MILLIS = 60000 * 30; // 30 minutes

@@ -742,6 +744,20 @@ public class Log {
        }
    }

    public static void event(Call call, String event, String format, Object... args) {
        String msg;
        try {
            msg = (args == null || args.length == 0) ? format
                    : String.format(Locale.US, format, args);
        } catch (IllegalFormatException ife) {
            e("Log", ife, "IllegalFormatException: formatString='%s' numArgs=%d", format,
                    args.length);
            msg = format + " (An error occurred while formatting the message.)";
        }

        event(call, event, msg);
    }

    @VisibleForTesting
    public static synchronized void cleanupStaleSessions(long timeoutMs) {
        String logMessage = "Stale Sessions Cleaned:\n";