diff options
author | 2014-02-09 22:01:23 +0900 | |
---|---|---|
committer | 2014-02-09 23:45:23 +0900 | |
commit | 45eb5d924d245618ec6066f631a99779617de057 (patch) | |
tree | 12ba103346c3246477a5c3d64e84a11e8c00d56a /java/src | |
parent | c44cbf6a3df629d79d720de034255cd98e48c28a (diff) | |
download | latinime-45eb5d924d245618ec6066f631a99779617de057.tar.gz latinime-45eb5d924d245618ec6066f631a99779617de057.tar.xz latinime-45eb5d924d245618ec6066f631a99779617de057.zip |
Allow an empty keySpec for Spacer
Bug: 12933248
Change-Id: I76432556caf319ce23c1fb7fa3d6b94118e64cf8
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/Key.java | 6 |
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); |