aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-02-13 02:13:00 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-13 02:13:00 -0800
commitef30447d2a9407693dfcdb55bf360db35a81b725 (patch)
treed7a8fdf5beed321bc5a53f1683c0fcf3f7861cd6
parent8950f96b842edfe4d900eb61bf7544f3afc02562 (diff)
parent5e099580565039dfd19cc23eff5e086202473fcd (diff)
downloadlatinime-ef30447d2a9407693dfcdb55bf360db35a81b725.tar.gz
latinime-ef30447d2a9407693dfcdb55bf360db35a81b725.tar.xz
latinime-ef30447d2a9407693dfcdb55bf360db35a81b725.zip
am 5e099580: Merge "Backward compatibility hack : send delete when empty."
* commit '5e099580565039dfd19cc23eff5e086202473fcd': Backward compatibility hack : send delete when empty.
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 7d6156959..bd114ebca 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -973,7 +973,13 @@ public final class InputLogic {
} else {
final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor();
if (codePointBeforeCursor == Constants.NOT_A_CODE) {
- // Nothing to delete before the cursor.
+ // HACK for backward compatibility with broken apps that haven't realized
+ // yet that hardware keyboards are not the only way of inputting text.
+ // Nothing to delete before the cursor. We should not do anything, but many
+ // broken apps expect something to happen in this case so that they can
+ // catch it and have their broken interface react. If you need the keyboard
+ // to do this, you're doing it wrong -- please fix your app.
+ mConnection.deleteSurroundingText(1, 0);
return;
}
final int lengthToDelete =