aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-02-09 07:37:32 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-09 07:37:32 -0800
commit4282efc7adf9db78b9f02b6a91b67b32c78d9867 (patch)
tree237728cd078a638a5fdb5a442dcb76ca1b9d77ef
parenta3314f919bb692082fab756f4a99555140751302 (diff)
parent45eb5d924d245618ec6066f631a99779617de057 (diff)
downloadlatinime-4282efc7adf9db78b9f02b6a91b67b32c78d9867.tar.gz
latinime-4282efc7adf9db78b9f02b6a91b67b32c78d9867.tar.xz
latinime-4282efc7adf9db78b9f02b6a91b67b32c78d9867.zip
am 45eb5d92: Allow an empty keySpec for Spacer
* commit '45eb5d924d245618ec6066f631a99779617de057': Allow an empty keySpec for Spacer
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 1c8bada15..aade490ac 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -316,8 +316,10 @@ public class Key implements Comparable<Key> {
mActionFlags = actionFlags;
final String keySpec = style.getString(keyAttr, R.styleable.Keyboard_Key_keySpec);
- if (TextUtils.isEmpty(keySpec)) {
- throw new RuntimeException("Empty keySpec");
+ // Note: {@link Spacer} has an empty keySpec.
+ // TODO: Create a Key constructor that parses only key geometries and share it with Spacer.
+ if (TextUtils.isEmpty(keySpec) && !(this instanceof Spacer)) {
+ throw new RuntimeException("Empty keySpec found in " + getClass().getName());
}
mIconId = KeySpecParser.getIconId(keySpec);