diff options
author | wangqi <wangqi@google.com> | 2018-02-15 16:21:49 -0800 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2018-02-22 21:06:27 +0000 |
commit | 153af2febd64f989f5e67c51c0653489e3339a1a (patch) | |
tree | 08c008a84c41fabcc13c33c769643b34cbd7553d /java/com/android/incallui/rtt/impl/RttChatFragment.java | |
parent | 3da989d320eff8bae7491d7ab528abd5582a3594 (diff) |
Implement read/write text stream to RttCall.
This change also:
1. Add simulator support of RTT request during call (always accept at this moment, will add random accept/decline in the future)
2. Fix bugs of putting RTT call in background and back to call
Bug: 67596257
Test: Simulator
PiperOrigin-RevId: 185920527
Change-Id: I51016fa6cf1ccc8a5a21335f9dacf286ae393706
Diffstat (limited to 'java/com/android/incallui/rtt/impl/RttChatFragment.java')
-rw-r--r-- | java/com/android/incallui/rtt/impl/RttChatFragment.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/java/com/android/incallui/rtt/impl/RttChatFragment.java b/java/com/android/incallui/rtt/impl/RttChatFragment.java index c7ee2ff67..ba99b2bf6 100644 --- a/java/com/android/incallui/rtt/impl/RttChatFragment.java +++ b/java/com/android/incallui/rtt/impl/RttChatFragment.java @@ -132,7 +132,7 @@ public class RttChatFragment extends Fragment FragmentUtils.getParentUnsafe(this, RttCallScreenDelegateFactory.class) .newRttCallScreenDelegate(this); - rttCallScreenDelegate.initRttCallScreenDelegate(getContext(), this); + rttCallScreenDelegate.initRttCallScreenDelegate(this); inCallScreenDelegate.onInCallScreenDelegateInit(this); inCallScreenDelegate.onInCallScreenReady(); @@ -193,7 +193,24 @@ public class RttChatFragment extends Fragment if (isClearingInput) { return; } - adapter.addLocalMessage(RttChatMessage.getChangedString(s, start, before, count)); + String messageToAppend = RttChatMessage.getChangedString(s, start, before, count); + if (!TextUtils.isEmpty(messageToAppend)) { + adapter.addLocalMessage(messageToAppend); + rttCallScreenDelegate.onLocalMessage(messageToAppend); + } + } + + @Override + public void onRemoteMessage(String message) { + adapter.addRemoteMessage(message); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + LogUtil.enterBlock("RttChatFragment.onDestroyView"); + inCallButtonUiDelegate.onInCallButtonUiUnready(); + inCallScreenDelegate.onInCallScreenUnready(); } @Override |