summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/Logging/SessionManager.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2020-05-04 15:01:59 -0700
committerTyler Gunn <tgunn@google.com>2020-05-05 09:34:07 -0700
commitffbcd894530ccfa548df74178495a46a0058504e (patch)
treeea5c9d4f813ab0e8c232b01f22d873f4cb98784f /telecomm/java/android/telecom/Logging/SessionManager.java
parent31d3998a0584300f78e4c709ceeaf81bfa8af70c (diff)
Improve connection manager logging.
1. In ConnectionService, upping the incoming log level to info from debug; this ensures we can better trace whether methods are actually called. 2. Added the ability in the logging class to get a new external session which supplies the owner info which will be passed in to the recipient of the external session. This allows Telecom or a connection manager to pass in a package abbreviation which will form the calling owner info when the receiver continues the external session. 3. Add owner info to the Session.Info class so it can be passed about. 4. Ensure owner info is copied when getting Session.Info; subsessions were not showing the owner info in the past; this corrects that. 5. When retrieving the external session info, creating a "package call stack" with the owner info. This lets us see the hierarchy of where calls originated. Example: cad/cast/ccme Shows that com.android.dialer send a message to com.android.server.telecom which relayed a message to com.connection.manager.example. 6. Start sessions in RemoteConnection API methods and pass along external session info. This bridges session tracing across a connection manager so we can now trace a method call all the way from dialer, through telecom, through the connection manager, and finally into telephony. Test: Manual call testing with connection manager to verify log behavior. Bug: 153899641 Change-Id: I4518a50550203818374b4e0b52eccb84ffd561dc
Diffstat (limited to 'telecomm/java/android/telecom/Logging/SessionManager.java')
-rw-r--r--telecomm/java/android/telecom/Logging/SessionManager.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/telecomm/java/android/telecom/Logging/SessionManager.java b/telecomm/java/android/telecom/Logging/SessionManager.java
index ac300587cef8..67e5eabf54eb 100644
--- a/telecomm/java/android/telecom/Logging/SessionManager.java
+++ b/telecomm/java/android/telecom/Logging/SessionManager.java
@@ -16,6 +16,7 @@
package android.telecom.Logging;
+import android.annotation.Nullable;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
@@ -180,7 +181,7 @@ public class SessionManager {
Log.d(LOGGING_TAG, Session.START_EXTERNAL_SESSION);
Session externalSession = new Session(Session.EXTERNAL_INDICATOR + sessionInfo.sessionId,
sessionInfo.methodPath, System.currentTimeMillis(),
- false /*isStartedFromActiveSession*/, null);
+ false /*isStartedFromActiveSession*/, sessionInfo.ownerInfo);
externalSession.setIsExternal(true);
// Mark the external session as already completed, since we have no way of knowing when
// the external session actually has completed.
@@ -224,7 +225,7 @@ public class SessionManager {
// Start execution time of the session will be overwritten in continueSession(...).
Session newSubsession = new Session(threadSession.getNextChildId(),
threadSession.getShortMethodName(), System.currentTimeMillis(),
- isStartedFromActiveSession, null);
+ isStartedFromActiveSession, threadSession.getOwnerInfo());
threadSession.addChild(newSubsession);
newSubsession.setParentSession(threadSession);
@@ -238,12 +239,18 @@ public class SessionManager {
return newSubsession;
}
+ public synchronized Session.Info getExternalSession() {
+ return getExternalSession(null /* ownerInfo */);
+ }
+
/**
* Retrieve the information of the currently active Session. This information is parcelable and
* is used to create an external Session ({@link #startExternalSession(Session.Info, String)}).
* If there is no Session active, this method will return null.
+ * @param ownerInfo Owner information for the session.
+ * @return The session information
*/
- public synchronized Session.Info getExternalSession() {
+ public synchronized Session.Info getExternalSession(@Nullable String ownerInfo) {
int threadId = getCallingThreadId();
Session threadSession = mSessionMapper.get(threadId);
if (threadSession == null) {
@@ -251,8 +258,7 @@ public class SessionManager {
"active.");
return null;
}
-
- return threadSession.getInfo();
+ return threadSession.getExternalInfo(ownerInfo);
}
/**