diff options
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/dialer/logging/LoggingBindings.java | 13 | ||||
-rw-r--r-- | java/com/android/dialer/logging/LoggingBindingsStub.java | 6 | ||||
-rw-r--r-- | java/com/android/incallui/InCallActivity.java | 10 | ||||
-rw-r--r-- | java/com/android/incallui/call/CallList.java | 13 |
4 files changed, 42 insertions, 0 deletions
diff --git a/java/com/android/dialer/logging/LoggingBindings.java b/java/com/android/dialer/logging/LoggingBindings.java index ca9a0533e..7682c767d 100644 --- a/java/com/android/dialer/logging/LoggingBindings.java +++ b/java/com/android/dialer/logging/LoggingBindings.java @@ -20,6 +20,13 @@ import android.widget.QuickContactBadge; /** Allows the container application to gather analytics. */ public interface LoggingBindings { + String ON_CREATE_PRIMES_EVENT_NAME = "Application.onCreate"; + String ON_CREATE_TO_ACTIVITY_ON_CREATE_PRIMES_EVENT_NAME = + "Application.onCreate_To_GoogleDialtactsActivity.onCreate"; + String ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING = + "CallList.onCallAdded_To_InCallActivity.onCreate_Incoming"; + String ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING = + "CallList.onCallAdded_To_InCallActivity.onCreate_Outgoing"; /** * Logs an DialerImpression event that's not associated with a specific call. * @@ -87,4 +94,10 @@ public interface LoggingBindings { /** Logs successful People Api lookup result */ void logSuccessfulPeopleApiLookupReport(long latency, int httpResponseCode); + + /** Log start a latency timer */ + void logStartLatencyTimer(String timerEventName); + + /** Log end a latency timer */ + void logStopLatencyTimer(String timerEventName); } diff --git a/java/com/android/dialer/logging/LoggingBindingsStub.java b/java/com/android/dialer/logging/LoggingBindingsStub.java index 2dbcc3ffb..ab6872cf4 100644 --- a/java/com/android/dialer/logging/LoggingBindingsStub.java +++ b/java/com/android/dialer/logging/LoggingBindingsStub.java @@ -61,4 +61,10 @@ public class LoggingBindingsStub implements LoggingBindings { @Override public void logSuccessfulPeopleApiLookupReport(long latency, int httpResponseCode) {} + + @Override + public void logStartLatencyTimer(String timerEventName) {} + + @Override + public void logStopLatencyTimer(String timerEventName) {} } diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index c3a68c021..c509e4890 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -40,6 +40,8 @@ import com.android.dialer.compat.ActivityCompat; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; +import com.android.dialer.logging.LoggingBindings; +import com.android.dialer.logging.LoggingBindingsFactory; import com.android.dialer.logging.ScreenEvent; import com.android.incallui.answer.bindings.AnswerBindings; import com.android.incallui.answer.protocol.AnswerScreen; @@ -145,6 +147,14 @@ public class InCallActivity extends TransactionSafeFragmentActivity pseudoBlackScreenOverlay = findViewById(R.id.psuedo_black_screen_overlay); sendBroadcast(CallPendingActivity.getFinishBroadcast()); Trace.endSection(); + if (getApplicationContext() instanceof LoggingBindingsFactory) { + LoggingBindings loggingBindings = + ((LoggingBindingsFactory) getApplicationContext()).newLoggingBindings(); + loggingBindings.logStopLatencyTimer( + LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING); + loggingBindings.logStopLatencyTimer( + LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING); + } } @Override diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java index 59f38349a..4f1dfd43f 100644 --- a/java/com/android/incallui/call/CallList.java +++ b/java/com/android/incallui/call/CallList.java @@ -36,6 +36,8 @@ import com.android.dialer.enrichedcall.EnrichedCallComponent; import com.android.dialer.enrichedcall.EnrichedCallManager; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; +import com.android.dialer.logging.LoggingBindings; +import com.android.dialer.logging.LoggingBindingsFactory; import com.android.dialer.shortcuts.ShortcutUsageReporter; import com.android.dialer.spam.Spam; import com.android.dialer.spam.SpamBindings; @@ -117,6 +119,17 @@ public class CallList implements DialerCallDelegate { public void onCallAdded( final Context context, final android.telecom.Call telecomCall, LatencyReport latencyReport) { Trace.beginSection("CallList.onCallAdded"); + if (context.getApplicationContext() instanceof LoggingBindingsFactory) { + if (telecomCall.getState() == Call.STATE_CONNECTING) { + ((LoggingBindingsFactory) context.getApplicationContext()) + .newLoggingBindings() + .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING); + } else if (telecomCall.getState() == Call.STATE_RINGING) { + ((LoggingBindingsFactory) context.getApplicationContext()) + .newLoggingBindings() + .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING); + } + } if (mUiListeners != null) { mUiListeners.onCallAdded(); } |