diff options
author | Jean Chalard <jchalard@google.com> | 2011-10-20 19:50:45 +0900 |
---|---|---|
committer | Jean Chalard <jchalard@google.com> | 2011-10-20 20:55:08 +0900 |
commit | de9dbb05ce57a1617efc131f6a724c2a2b164bf7 (patch) | |
tree | 121172bfd8498215b2f9ed020ec51f5e453479a4 | |
parent | 149a14931e5aa4beb8c4263995f01437a8918465 (diff) | |
download | frameworks_base-de9dbb05ce57a1617efc131f6a724c2a2b164bf7.zip frameworks_base-de9dbb05ce57a1617efc131f6a724c2a2b164bf7.tar.gz frameworks_base-de9dbb05ce57a1617efc131f6a724c2a2b164bf7.tar.bz2 |
Fix a warning from the binder, step 2.
This patch fixes the following warning:
W/Binder: The following Binder class should be static or
leaks might occur: android.view.inputmethod
.InputMethodManager.ControlledInputConnectionWrapper
...in hope of removing a possible memory leaks.
Change-Id: I081d10fd839f2985d7081492f4f5cf0b4da42fd2
Bugs: 5481376, 5461066
-rw-r--r-- | core/java/android/view/inputmethod/InputMethodManager.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 3ead9df..b41e6f5 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -384,14 +384,18 @@ public final class InputMethodManager { } } - class ControlledInputConnectionWrapper extends IInputConnectionWrapper { - public ControlledInputConnectionWrapper(Looper mainLooper, InputConnection conn) { + private static class ControlledInputConnectionWrapper extends IInputConnectionWrapper { + private final InputMethodManager mParentInputMethodManager; + + public ControlledInputConnectionWrapper(final Looper mainLooper, final InputConnection conn, + final InputMethodManager inputMethodManager) { super(mainLooper, conn); + mParentInputMethodManager = inputMethodManager; } @Override public boolean isActive() { - return mActive; + return mParentInputMethodManager.mActive; } } @@ -439,7 +443,7 @@ public final class InputMethodManager { mMainLooper = looper; mH = new H(looper); mIInputContext = new ControlledInputConnectionWrapper(looper, - mDummyInputConnection); + mDummyInputConnection, this); if (mInstance == null) { mInstance = this; @@ -1016,7 +1020,7 @@ public final class InputMethodManager { mCursorCandStart = -1; mCursorCandEnd = -1; mCursorRect.setEmpty(); - servedContext = new ControlledInputConnectionWrapper(vh.getLooper(), ic); + servedContext = new ControlledInputConnectionWrapper(vh.getLooper(), ic, this); } else { servedContext = null; } |