Merge "Add Telecom events for local ringback." into pi-dev
diff --git a/src/com/android/server/telecom/LogUtils.java b/src/com/android/server/telecom/LogUtils.java
index fcf914e..c4ccd8b 100644
--- a/src/com/android/server/telecom/LogUtils.java
+++ b/src/com/android/server/telecom/LogUtils.java
@@ -134,6 +134,8 @@
         public static final String ACCEPT_HANDOVER = "ACCEPT_HANDOVER";
         public static final String HANDOVER_COMPLETE = "HANDOVER_COMPLETE";
         public static final String HANDOVER_FAILED = "HANDOVER_FAILED";
+        public static final String START_RINBACK = "START_RINGBACK";
+        public static final String STOP_RINGBACK = "STOP_RINGBACK";
 
         public static class Timings {
             public static final String ACCEPT_TIMING = "accept";
diff --git a/src/com/android/server/telecom/RingbackPlayer.java b/src/com/android/server/telecom/RingbackPlayer.java
index 47b6dfe..a8af3ac 100644
--- a/src/com/android/server/telecom/RingbackPlayer.java
+++ b/src/com/android/server/telecom/RingbackPlayer.java
@@ -16,6 +16,9 @@
 
 package com.android.server.telecom;
 
+import static com.android.server.telecom.LogUtils.Events.START_RINBACK;
+import static com.android.server.telecom.LogUtils.Events.STOP_RINGBACK;
+
 import com.android.internal.util.Preconditions;
 import android.telecom.Log;
 
@@ -64,7 +67,8 @@
 
         mCall = call;
         if (mTonePlayer == null) {
-            Log.d(this, "Playing the ringback tone for %s.", call);
+            Log.i(this, "Playing the ringback tone for %s.", call);
+            Log.addEvent(call, START_RINBACK);
             mTonePlayer = mPlayerFactory.createPlayer(InCallTonePlayer.TONE_RING_BACK);
             mTonePlayer.startTone();
         }
@@ -85,6 +89,7 @@
                 Log.w(this, "No player found to stop.");
             } else {
                 Log.i(this, "Stopping the ringback tone for %s.", call);
+                Log.addEvent(call, STOP_RINGBACK);
                 mTonePlayer.stopTone();
                 mTonePlayer = null;
             }