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

Commit 89c59063 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Add telecom log marking shell command.

We often get bugs where testers have executed a LONG list of test steps.
It becomes extremely difficult to know where in the logs corresponds to
which test script step.

This adds a new telecom shell command:
adb shell telecom log-mark Testing 1 2 3

This command adds a USER_LOG_MARK event log item to all ongoing calls and
to the general telecom logs with the specified message.

Test: Tested using the new shell command to mark the telecom logs in and out of calls.
Fixes: 228895073
Change-Id: I426cc6842d382b68275adbf37a31cddd7666fa86
parent 6179d11a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -5583,4 +5583,16 @@ public class CallsManager extends Call.ListenerBase
            UserHandle userHandle, ConnectionServiceWrapper service) {
        mConnectionServiceRepository.setService(componentName, userHandle, service);
    }

    /**
     * Generates a log "marking".  This is a unique call event which contains a specified message.
     * A log mark is triggered by the command: adb shell telecom log-mark MESSAGE
     * A tester can use this when executing tests to make it very clear when a particular test step
     * was reached.
     * @param message the message to mark in the logs.
     */
    public void requestLogMark(String message) {
        mCalls.forEach(c -> Log.addEvent(c, LogUtils.Events.USER_LOG_MARK, message));
        Log.addEvent(null /* global */, LogUtils.Events.USER_LOG_MARK, message);
    }
}
+18 −0
Original line number Diff line number Diff line
@@ -1960,6 +1960,24 @@ public class TelecomServiceImpl {
            }
        }

        @Override
        public void requestLogMark(String message) {
            try {
                Log.startSession("TSI.rLM");
                enforceShellOnly(Binder.getCallingUid(), "requestLogMark is for shell only");
                synchronized (mLock) {
                    long token = Binder.clearCallingIdentity();
                    try {
                        mCallsManager.requestLogMark(message);
                    } finally {
                        Binder.restoreCallingIdentity(token);
                    }
                }
            } finally {
                Log.endSession();
            }
        }

        @Override
        public void setTestPhoneAcctSuggestionComponent(String flattenedComponentName) {
            try {