From c3c6126757e3b185587909e6ac9c7c6e897df4f9 Mon Sep 17 00:00:00 2001 From: mdooley Date: Wed, 27 Sep 2017 09:53:07 -0700 Subject: Adding logging for transcription polling requests This will allow us to tune the polling rate. Bug: 66966157 Test: none PiperOrigin-RevId: 170210987 Change-Id: I6ef204acc6e0d43a3ada524511866d4a629fe1e2 --- java/com/android/dialer/logging/dialer_impression.proto | 3 +++ java/com/android/voicemail/impl/transcribe/TranscriptionTask.java | 2 +- java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/com/android/dialer/logging/dialer_impression.proto b/java/com/android/dialer/logging/dialer_impression.proto index d5f1963d2..fe1c5e9ba 100644 --- a/java/com/android/dialer/logging/dialer_impression.proto +++ b/java/com/android/dialer/logging/dialer_impression.proto @@ -551,5 +551,8 @@ message DialerImpression { LIGHTBRINGER_NON_CONTACT_UPGRADE_REQUESTED = 1281; LIGHTBRINGER_NON_CONTACT_VIDEO_REQUESTED_FROM_CALL_LOG = 1282; // Including call history + + // More voicemail transcription impressions + VVM_TRANSCRIPTION_POLL_REQUEST = 1283; } } diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java b/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java index 60b97dad5..a93c65151 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java @@ -57,7 +57,7 @@ import java.io.InputStream; public abstract class TranscriptionTask implements Runnable { private static final String TAG = "TranscriptionTask"; - private final Context context; + protected final Context context; private final JobCallback callback; private final JobWorkItem workItem; private final TranscriptionClientFactory clientFactory; diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java b/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java index 930d7f113..e75728014 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java @@ -20,6 +20,7 @@ import android.content.Context; import android.util.Pair; import com.android.dialer.common.Assert; import com.android.dialer.logging.DialerImpression; +import com.android.dialer.logging.Logger; import com.android.voicemail.impl.VvmLog; import com.android.voicemail.impl.transcribe.TranscriptionService.JobCallback; import com.android.voicemail.impl.transcribe.grpc.GetTranscriptResponseAsync; @@ -94,6 +95,7 @@ public class TranscriptionTaskAsync extends TranscriptionTask { VvmLog.i(TAG, "pollForTranscription, cancelled."); return new Pair<>(null, TranscriptionStatus.FAILED_NO_RETRY); } + Logger.get(context).logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_POLL_REQUEST); GetTranscriptResponseAsync response = (GetTranscriptResponseAsync) sendRequest((client) -> client.sendGetTranscriptRequest(request)); -- cgit v1.2.3