From dbadee96b6bc385b18377bd8b943e79097853849 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 31 Mar 2014 14:43:08 +0900 Subject: Do not create a handler thread for each session Bug: 13710224 Bug: 12821388 Bug: 12667742 Change-Id: I6188e0240193d2bca789110e7660a0f31bbafc62 --- .../com/android/inputmethod/latin/inputlogic/InputLogic.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java') diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index e2cdbb39c..10b4cada3 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -130,8 +130,11 @@ public final class InputLogic { // so we try using some heuristics to find out about these and fix them. mConnection.tryFixLyingCursorPosition(); cancelDoubleSpacePeriodCountdown(); - mInputLogicHandler.destroy(); - mInputLogicHandler = new InputLogicHandler(mLatinIME, this); + if (InputLogicHandler.NULL_HANDLER == mInputLogicHandler) { + mInputLogicHandler = new InputLogicHandler(mLatinIME, this); + } else { + mInputLogicHandler.reset(); + } } /** @@ -142,8 +145,7 @@ public final class InputLogic { mConnection.finishComposingText(); } resetComposingState(true /* alsoResetLastComposedWord */); - mInputLogicHandler.destroy(); - mInputLogicHandler = InputLogicHandler.NULL_HANDLER; + mInputLogicHandler.reset(); } /** -- cgit v1.2.3-83-g751a