diff options
| author | Jean Chalard <jchalard@google.com> | 2011-10-20 20:36:07 +0900 |
|---|---|---|
| committer | Jean Chalard <jchalard@google.com> | 2011-10-20 20:45:21 +0900 |
| commit | e0d32a60da29e133e5b4ff46133628476d83872c (patch) | |
| tree | 70078efbf3d83ec6f37bf7ae434902bb54978713 /services/java/com/android/server/InputMethodManagerService.java | |
| parent | 149a14931e5aa4beb8c4263995f01437a8918465 (diff) | |
Fix a warning from the binder, step 3.
This patch fixes the following warning:
W/Binder: The following Binder class should be static or
leaks might occur: com.android.server
.InputMethodManagerService.MethodCallback
...in hope of removing a possible memory leaks.
Bugs: 5481376, 5461066
Change-Id: I1764090a7059d9bf9e5d90683d7ac190c83415de
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
| -rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 6ddbf5a5a95f..03d6b418f97d 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -493,11 +493,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } - class MethodCallback extends IInputMethodCallback.Stub { - final IInputMethod mMethod; + private static class MethodCallback extends IInputMethodCallback.Stub { + private final IInputMethod mMethod; + private final InputMethodManagerService mParentIMMS; - MethodCallback(IInputMethod method) { + MethodCallback(final IInputMethod method, final InputMethodManagerService imms) { mMethod = method; + mParentIMMS = imms; } @Override @@ -506,7 +508,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub @Override public void sessionCreated(IInputMethodSession session) throws RemoteException { - onSessionCreated(mMethod, session); + mParentIMMS.onSessionCreated(mMethod, session); } } @@ -837,7 +839,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (DEBUG) Slog.v(TAG, "Creating new session for client " + cs); executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO( MSG_CREATE_SESSION, mCurMethod, - new MethodCallback(mCurMethod))); + new MethodCallback(mCurMethod, this))); } // Return to client, and we will get back with it when // we have had a session made for it. @@ -943,7 +945,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub + mCurClient); executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO( MSG_CREATE_SESSION, mCurMethod, - new MethodCallback(mCurMethod))); + new MethodCallback(mCurMethod, this))); } } } |
