diff options
author | mdooley <mdooley@google.com> | 2017-06-23 13:27:44 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-06-26 09:02:40 -0700 |
commit | 268a1958d493a9c0110e2524848cd27c1929bf89 (patch) | |
tree | 4c60a27a59052287c75f0b9c96b518c50633ae7c /java/com/android/voicemail/impl | |
parent | 9e71c63d0d45007363827d3cd7969ddd5e70e035 (diff) |
Adding voicemail transcription impression logging
Logging impressions for interactions with the voicemail transcription server.
Bug: 62423554
Test: none
PiperOrigin-RevId: 159985772
Change-Id: I782d7eb4df917ae42940f359d98abc87f7ec0f95
Diffstat (limited to 'java/com/android/voicemail/impl')
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionTask.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java b/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java index 0fbc33ad5..a14b6df91 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionTask.java @@ -21,6 +21,8 @@ import android.content.Context; import android.net.Uri; import android.text.TextUtils; import com.android.dialer.common.concurrent.ThreadUtil; +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.TranscriptionClient; @@ -98,24 +100,37 @@ public class TranscriptionTask implements Runnable { String transcript = null; for (int i = 0; transcript == null && i < MAX_RETRIES; i++) { VvmLog.i(TAG, "transcribeVoicemail, try: " + (i + 1)); + if (i == 0) { + Logger.get(context).logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_REQUEST_SENT); + } else { + Logger.get(context).logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_REQUEST_RETRY); + } TranscriptionClient.TranscriptionResponseWrapper responseWrapper = client.transcribeVoicemail(request); if (responseWrapper.status != null) { VvmLog.i(TAG, "transcribeVoicemail, status: " + responseWrapper.status.getCode()); if (shouldRetryRequest(responseWrapper.status)) { + Logger.get(context) + .logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_RESPONSE_RECOVERABLE_ERROR); backoff(i); } else { + Logger.get(context) + .logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_RESPONSE_FATAL_ERROR); break; } } else if (responseWrapper.response != null) { if (!TextUtils.isEmpty(responseWrapper.response.getTranscript())) { VvmLog.i(TAG, "transcribeVoicemail, got response"); transcript = responseWrapper.response.getTranscript(); + Logger.get(context) + .logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_RESPONSE_SUCCESS); } else { VvmLog.i(TAG, "transcribeVoicemail, empty transcription"); + Logger.get(context).logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_RESPONSE_EMPTY); } } else { VvmLog.w(TAG, "transcribeVoicemail, no response"); + Logger.get(context).logImpression(DialerImpression.Type.VVM_TRANSCRIPTION_RESPONSE_INVALID); } } |