summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/app/DialtactsActivity.java11
-rw-r--r--java/com/android/incallui/InCallActivity.java23
-rw-r--r--java/com/android/incallui/call/CallList.java17
3 files changed, 16 insertions, 35 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java
index 5af9b95ac..12c191e53 100644
--- a/java/com/android/dialer/app/DialtactsActivity.java
+++ b/java/com/android/dialer/app/DialtactsActivity.java
@@ -112,7 +112,6 @@ import com.android.dialer.interactions.PhoneNumberInteraction.InteractionErrorCo
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.dialer.logging.UiAction;
import com.android.dialer.main.Main;
@@ -593,13 +592,9 @@ public class DialtactsActivity extends TransactionSafeActivity
}
// add 1 sec delay to get memory snapshot so that dialer wont react slowly on resume.
ThreadUtil.postDelayedOnUiThread(
- () -> {
- if (getApplicationContext() instanceof LoggingBindingsFactory) {
- ((LoggingBindingsFactory) getApplicationContext())
- .newLoggingBindings()
- .logRecordMemory(LoggingBindings.ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME);
- }
- },
+ () ->
+ Logger.get(this)
+ .logRecordMemory(LoggingBindings.ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME),
1000);
}
diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java
index 34ffdf5b7..cdab6b4f5 100644
--- a/java/com/android/incallui/InCallActivity.java
+++ b/java/com/android/incallui/InCallActivity.java
@@ -42,7 +42,6 @@ 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;
@@ -148,14 +147,10 @@ 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);
- }
+ Logger.get(this)
+ .logStopLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING);
+ Logger.get(this)
+ .logStopLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING);
}
@Override
@@ -199,13 +194,9 @@ public class InCallActivity extends TransactionSafeFragmentActivity
Trace.endSection();
// add 1 sec delay to get memory snapshot so that dialer wont react slowly on resume.
ThreadUtil.postDelayedOnUiThread(
- () -> {
- if (getApplicationContext() instanceof LoggingBindingsFactory) {
- ((LoggingBindingsFactory) getApplicationContext())
- .newLoggingBindings()
- .logRecordMemory(LoggingBindings.INCALL_ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME);
- }
- },
+ () ->
+ Logger.get(this)
+ .logRecordMemory(LoggingBindings.INCALL_ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME),
1000);
}
diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java
index 4f1dfd43f..fd43a4aaa 100644
--- a/java/com/android/incallui/call/CallList.java
+++ b/java/com/android/incallui/call/CallList.java
@@ -37,7 +37,6 @@ 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;
@@ -119,16 +118,12 @@ 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 (telecomCall.getState() == Call.STATE_CONNECTING) {
+ Logger.get(context)
+ .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING);
+ } else if (telecomCall.getState() == Call.STATE_RINGING) {
+ Logger.get(context)
+ .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING);
}
if (mUiListeners != null) {
mUiListeners.onCallAdded();