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

Commit 8186e783 authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

Merge "Add telecom log marking shell command." am: 6dcbe63a am: 3d0b04d1...

Merge "Add telecom log marking shell command." am: 6dcbe63a am: 3d0b04d1 am: e5128b76 am: 0ba96e08

Original change: https://android-review.googlesource.com/c/platform/packages/services/Telecomm/+/2060756



Change-Id: If0fd76eca0e32aa0b1488f4630630aa0e8eaa5dd
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 546a4a06 0ba96e08
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -5596,4 +5596,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
@@ -2025,6 +2025,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 {