Do not create a handler thread for each session
Bug: 13710224 Bug: 12821388 Bug: 12667742 Change-Id: I6188e0240193d2bca789110e7660a0f31bbafc62
This commit is contained in:
parent
89df80292e
commit
dbadee96b6
2 changed files with 9 additions and 7 deletions
|
@ -130,8 +130,11 @@ public final class InputLogic {
|
||||||
// so we try using some heuristics to find out about these and fix them.
|
// so we try using some heuristics to find out about these and fix them.
|
||||||
mConnection.tryFixLyingCursorPosition();
|
mConnection.tryFixLyingCursorPosition();
|
||||||
cancelDoubleSpacePeriodCountdown();
|
cancelDoubleSpacePeriodCountdown();
|
||||||
mInputLogicHandler.destroy();
|
if (InputLogicHandler.NULL_HANDLER == mInputLogicHandler) {
|
||||||
mInputLogicHandler = new InputLogicHandler(mLatinIME, this);
|
mInputLogicHandler = new InputLogicHandler(mLatinIME, this);
|
||||||
|
} else {
|
||||||
|
mInputLogicHandler.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -142,8 +145,7 @@ public final class InputLogic {
|
||||||
mConnection.finishComposingText();
|
mConnection.finishComposingText();
|
||||||
}
|
}
|
||||||
resetComposingState(true /* alsoResetLastComposedWord */);
|
resetComposingState(true /* alsoResetLastComposedWord */);
|
||||||
mInputLogicHandler.destroy();
|
mInputLogicHandler.reset();
|
||||||
mInputLogicHandler = InputLogicHandler.NULL_HANDLER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,7 +43,7 @@ class InputLogicHandler implements Handler.Callback {
|
||||||
// is initialized, though probably only the monkey can actually do this.
|
// is initialized, though probably only the monkey can actually do this.
|
||||||
public static final InputLogicHandler NULL_HANDLER = new InputLogicHandler() {
|
public static final InputLogicHandler NULL_HANDLER = new InputLogicHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void destroy() {}
|
public void reset() {}
|
||||||
@Override
|
@Override
|
||||||
public boolean handleMessage(final Message msg) { return true; }
|
public boolean handleMessage(final Message msg) { return true; }
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,8 +75,8 @@ class InputLogicHandler implements Handler.Callback {
|
||||||
mInputLogic = inputLogic;
|
mInputLogic = inputLogic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
public void reset() {
|
||||||
mNonUIThreadHandler.getLooper().quit();
|
mNonUIThreadHandler.removeCallbacksAndMessages(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue