summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/rtt/impl/RttChatFragment.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/java/com/android/incallui/rtt/impl/RttChatFragment.java b/java/com/android/incallui/rtt/impl/RttChatFragment.java
index 36235df19..73adb9f1c 100644
--- a/java/com/android/incallui/rtt/impl/RttChatFragment.java
+++ b/java/com/android/incallui/rtt/impl/RttChatFragment.java
@@ -177,10 +177,13 @@ public class RttChatFragment extends Fragment
editText.setOnKeyListener(
(v, keyCode, event) -> {
- // This is only triggered when input method doesn't handle delete key, which means the
- // current
- // input box is empty.
- if (keyCode == KeyEvent.KEYCODE_DEL && event.getAction() == KeyEvent.ACTION_DOWN) {
+ // This is only triggered when input method doesn't handle delete key, which usually means
+ // the current input box is empty.
+ // On non-English keyboard delete key could be passed here so we still need to check if
+ // the input box is empty.
+ if (keyCode == KeyEvent.KEYCODE_DEL
+ && event.getAction() == KeyEvent.ACTION_DOWN
+ && TextUtils.isEmpty(editText.getText())) {
String lastMessage = adapter.retrieveLastLocalMessage();
if (lastMessage != null) {
resumeInput(lastMessage);