From 6e0d639e70798ccbf805a540775e90f41dadae08 Mon Sep 17 00:00:00 2001 From: wangqi Date: Mon, 30 Apr 2018 16:22:34 -0700 Subject: 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 --- java/com/android/incallui/call/DialerCall.java | 4 ++++ 1 file changed, 4 insertions(+) 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<>(), -- cgit v1.2.3