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

Commit 6dcbe63a authored by Tyler Gunn's avatar Tyler Gunn Committed by Gerrit Code Review
Browse files

Merge "Add telecom log marking shell command."

parents 6cca360b 89c59063
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 {