Add guard to prevent possible IllegalStateException

Bug: 5227682
Change-Id: Iff93b425f52981b5e2c65e309b07bcfe4485eeb1
This commit is contained in:
Tadashi G. Takaoka 2011-08-29 18:36:26 +09:00
parent ed23cc7f0b
commit 46286874f3
2 changed files with 4 additions and 1 deletions

View file

@ -495,6 +495,9 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
@Override
public boolean onTouchEvent(MotionEvent me) {
if (getKeyboard() == null) {
return false;
}
return mTouchScreenRegulator.onTouchEvent(me);
}

View file

@ -283,7 +283,7 @@ public class PointerTracker {
mListener.onCancelInput();
}
public void setKeyDetectorInner(KeyDetector keyDetector) {
private void setKeyDetectorInner(KeyDetector keyDetector) {
mKeyDetector = keyDetector;
mKeyboard = keyDetector.getKeyboard();
mKeys = mKeyboard.mKeys;