diff options
author | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
commit | 628590d7ec80e10a3fc24b1c18a1afb55cca10a8 (patch) | |
tree | 4b1c3f52d86d7fb53afbe9e9438468588fa489f8 /telecomm/java/android/telecom/Logging/SessionManager.java | |
parent | b11b8ec3aec8bb42f2c07e1c5ac7942da293baa8 (diff) | |
parent | d2d3a20624d968199353ccf6ddbae6f3ac39c9af (diff) |
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
Diffstat (limited to 'telecomm/java/android/telecom/Logging/SessionManager.java')
-rw-r--r-- | telecomm/java/android/telecom/Logging/SessionManager.java | 16 |
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); } /** |