Merge "Clear IMM references when window dismissed." into jb-dev

This commit is contained in:
Jeff Sharkey
2012-04-27 16:44:22 -07:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -340,6 +340,14 @@ public class WindowManagerImpl implements WindowManager {
View curView = root.getView();
root.mAddNesting = 0;
if (view != null) {
InputMethodManager imm = InputMethodManager.getInstance(view.getContext());
if (imm != null) {
imm.windowDismissed(mViews[index].getWindowToken());
}
}
root.die(true);
finishRemoveViewLocked(curView, index);
if (curView == view) {

View File

@@ -672,6 +672,7 @@ public final class InputMethodManager {
* Disconnect any existing input connection, clearing the served view.
*/
void finishInputLocked() {
mCurRootView = null;
mNextServedView = null;
if (mServedView != null) {
if (DEBUG) Log.v(TAG, "FINISH INPUT: " + mServedView);