From c76ca765c3ee306ed2ccdc0a71e79e1dcc028715 Mon Sep 17 00:00:00 2001 From: Sailesh Nepal Date: Thu, 14 Apr 2016 20:38:40 -0700 Subject: Add LatencyReport for every call [This is a manual cherry pick from ub-contactsdialer-b-dev.] This CL tracks latency for all incoming and outgoing calls. We now measure the following latency values: - time for a connection service to add a call to telecom. - time for telecom to process a call - time for the dialer app to launch and have a call added to it by telecom. - time for dialer to check if a call should be blocked. - time to show a notification about the call (incoming only) - time it took to show the InCallUI (only if HUN wasn't displayed) Change-Id: I08685d312cbaefc564feb4119350da71df9b9e6c --- InCallUI/src/com/android/incallui/Call.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'InCallUI/src/com/android/incallui/Call.java') diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index 252c7016d..1ad37e01a 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -375,7 +375,8 @@ public class Call { } }; - private android.telecom.Call mTelecomCall; + private final android.telecom.Call mTelecomCall; + private final LatencyReport mLatencyReport; private boolean mIsEmergencyCall; private Uri mHandle; private final String mId; @@ -408,7 +409,7 @@ public class Call { private long mTimeAddedMs; - private LogState mLogState = new LogState(); + private final LogState mLogState = new LogState(); /** * Used only to create mock calls for testing @@ -416,6 +417,7 @@ public class Call { @NeededForTesting Call(int state) { mTelecomCall = null; + mLatencyReport = new LatencyReport(); mId = ID_PREFIX + Integer.toString(sIdCounter++); setState(state); } @@ -424,8 +426,8 @@ public class Call { * Creates a new instance of a {@link Call}. Registers a callback for * {@link android.telecom.Call} events. */ - public Call(android.telecom.Call telecomCall) { - this(telecomCall, true /* registerCallback */); + public Call(android.telecom.Call telecomCall, LatencyReport latencyReport) { + this(telecomCall, latencyReport, true /* registerCallback */); } /** @@ -435,8 +437,10 @@ public class Call { * Intended for use when creating a {@link Call} instance for use with the * {@link ContactInfoCache}, where we do not want to register callbacks for the new call. */ - public Call(android.telecom.Call telecomCall, boolean registerCallback) { + public Call(android.telecom.Call telecomCall, LatencyReport latencyReport, + boolean registerCallback) { mTelecomCall = telecomCall; + mLatencyReport = latencyReport; mId = ID_PREFIX + Integer.toString(sIdCounter++); updateFromTelecomCall(registerCallback); @@ -1012,4 +1016,8 @@ public class Call { public boolean isSpam() { return mIsSpam; } + + public LatencyReport getLatencyReport() { + return mLatencyReport; + } } -- cgit v1.2.3