OSDN Git Service

Adds registerSessionListener API to Log
authorBrad Ebinger <breadley@google.com>
Tue, 18 Oct 2016 20:48:17 +0000 (13:48 -0700)
committerBrad Ebinger <breadley@google.com>
Wed, 19 Oct 2016 21:32:46 +0000 (14:32 -0700)
Adds the registerSessionListener API to android.telecom.Log to allow
callbacks to occur when a session has been fully completed.
CP from internal branch.

Test: Manual Testing
Bug: 26571395
Change-Id: I70ebd6f432768a5d7bd8f3a0997b8e0ef335bb35

telecomm/java/android/telecom/Log.java
telecomm/java/android/telecom/Logging/EventManager.java
telecomm/java/android/telecom/Logging/SessionManager.java

index ecda3cd..01af76b 100644 (file)
@@ -199,6 +199,10 @@ public class Log {
         getSessionManager().endSession();
     }
 
+    public static void registerSessionListener(SessionManager.ISessionListener l) {
+        getSessionManager().registerSessionListener(l);
+    }
+
     public static String getSessionId() {
         // If the Session logger has not been initialized, then there have been no sessions logged.
         // Don't load it now!
index 0849804..4b40619 100644 (file)
@@ -366,8 +366,6 @@ public class EventManager {
         // Now add a new entry
         mEventRecords.add(newRecord);
         mCallEventRecordMap.put(recordEntry, newRecord);
-
-        // TODO: Add Implementation of this in Telecom for Analytics
         synchronized (mSync) {
             for (EventListener l : mEventListeners) {
                 l.eventRecordAdded(newRecord);
index 90daee0..add1237 100644 (file)
@@ -273,7 +273,6 @@ public class SessionManager {
                     System.currentTimeMillis() - subsession.getExecutionStartTimeMilliseconds();
             android.util.Slog.d(LOGGING_TAG, Session.END_SESSION + " (dur: " + fullSessionTimeMs
                     + " ms): " + subsession.toString());
-            // TODO: Add analytics hook
             for (ISessionListener l : mSessionListeners) {
                 l.sessionComplete(subsession.getShortMethodName(), fullSessionTimeMs);
             }