Skip to content

Commit a80838d

Browse files
author
Jean Chalard
committed
Fix a warning from the binder.
This patch fixes the following warning: W/Binder: The following Binder class should be static or leaks might occur: android.view.textservice .SpellCheckerSession.InternalListener ...in hope of removing a possible memory leaks. However in my tests it does nothing at all for the memory leak in bug 5461066, so it was probably unrelated. Change-Id: Id776665e9483121d22cc91e8d2d9f32e3413ec96 Bugs: 5481376,5461066
1 parent 149a149 commit a80838d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/java/android/view/textservice/SpellCheckerSession.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public SpellCheckerSession(
123123
}
124124
mSpellCheckerInfo = info;
125125
mSpellCheckerSessionListenerImpl = new SpellCheckerSessionListenerImpl(mHandler);
126-
mInternalListener = new InternalListener();
126+
mInternalListener = new InternalListener(mSpellCheckerSessionListenerImpl);
127127
mTextServicesManager = tsm;
128128
mIsUsed = true;
129129
mSpellCheckerSessionListener = listener;
@@ -316,13 +316,19 @@ public interface SpellCheckerSessionListener {
316316
public void onGetSuggestions(SuggestionsInfo[] results);
317317
}
318318

319-
private class InternalListener extends ITextServicesSessionListener.Stub {
319+
private static class InternalListener extends ITextServicesSessionListener.Stub {
320+
private final SpellCheckerSessionListenerImpl mParentSpellCheckerSessionListenerImpl;
321+
322+
public InternalListener(SpellCheckerSessionListenerImpl spellCheckerSessionListenerImpl) {
323+
mParentSpellCheckerSessionListenerImpl = spellCheckerSessionListenerImpl;
324+
}
325+
320326
@Override
321327
public void onServiceConnected(ISpellCheckerSession session) {
322328
if (DBG) {
323329
Log.w(TAG, "SpellCheckerSession connected.");
324330
}
325-
mSpellCheckerSessionListenerImpl.onServiceConnected(session);
331+
mParentSpellCheckerSessionListenerImpl.onServiceConnected(session);
326332
}
327333
}
328334

0 commit comments

Comments
 (0)