summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2018-04-30 16:22:34 -0700
committerCopybara-Service <copybara-piper@google.com>2018-04-30 18:19:51 -0700
commit6e0d639e70798ccbf805a540775e90f41dadae08 (patch)
treebafc2a022251fbbb48e3f6a7a35d0985065e381c
parenta7f50f29f0a762acc7d80691a939cd54207b7533 (diff)
Don't save transcript if it's empty.
Thre is no point to save an empty transcript. This change will also prevent showing transcript button in call details. Bug: 70177426 Test: manual PiperOrigin-RevId: 194863630 Change-Id: Iee4e5c0929c3ebfc75377ed0f529934a6cfe01f5
-rw-r--r--java/com/android/incallui/call/DialerCall.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index d736edc94..1c2744644 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -1102,6 +1102,10 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
} catch (IOException e) {
LogUtil.e("DialerCall.saveRttTranscript", "error when reading remaining message", e);
}
+ // Don't save transcript if it's empty.
+ if (rttTranscript.getMessagesCount() == 0) {
+ return;
+ }
Futures.addCallback(
RttTranscriptUtil.saveRttTranscript(context, rttTranscript),
new DefaultFutureCallback<>(),