Loading core/java/android/view/textservice/SpellCheckerSession.java +14 −8 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ import com.android.internal.textservice.ISpellCheckerSessionListener; import com.android.internal.textservice.ITextServicesManager; import com.android.internal.textservice.ITextServicesSessionListener; import dalvik.system.CloseGuard; import java.util.LinkedList; import java.util.Queue; Loading Loading @@ -98,7 +100,7 @@ public class SpellCheckerSession { private final SpellCheckerSessionListener mSpellCheckerSessionListener; private final SpellCheckerSessionListenerImpl mSpellCheckerSessionListenerImpl; private boolean mIsUsed; private final CloseGuard mGuard = CloseGuard.get(); /** Handler that will execute the main tasks */ private final Handler mHandler = new Handler() { Loading Loading @@ -128,8 +130,9 @@ public class SpellCheckerSession { mSpellCheckerSessionListenerImpl = new SpellCheckerSessionListenerImpl(mHandler); mInternalListener = new InternalListener(mSpellCheckerSessionListenerImpl); mTextServicesManager = tsm; mIsUsed = true; mSpellCheckerSessionListener = listener; mGuard.open("finishSession"); } /** Loading Loading @@ -160,7 +163,7 @@ public class SpellCheckerSession { * checker. */ public void close() { mIsUsed = false; mGuard.close(); try { mSpellCheckerSessionListenerImpl.close(); mTextServicesManager.finishSpellCheckerService(mSpellCheckerSessionListenerImpl); Loading Loading @@ -542,12 +545,15 @@ public class SpellCheckerSession { @Override protected void finalize() throws Throwable { super.finalize(); if (mIsUsed) { Log.e(TAG, "SpellCheckerSession was not finished properly." + "You should call finishSession() when you finished to use a spell checker."); try { // Note that mGuard will be null if the constructor threw. if (mGuard != null) { mGuard.warnIfOpen(); close(); } } finally { super.finalize(); } } /** Loading Loading
core/java/android/view/textservice/SpellCheckerSession.java +14 −8 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ import com.android.internal.textservice.ISpellCheckerSessionListener; import com.android.internal.textservice.ITextServicesManager; import com.android.internal.textservice.ITextServicesSessionListener; import dalvik.system.CloseGuard; import java.util.LinkedList; import java.util.Queue; Loading Loading @@ -98,7 +100,7 @@ public class SpellCheckerSession { private final SpellCheckerSessionListener mSpellCheckerSessionListener; private final SpellCheckerSessionListenerImpl mSpellCheckerSessionListenerImpl; private boolean mIsUsed; private final CloseGuard mGuard = CloseGuard.get(); /** Handler that will execute the main tasks */ private final Handler mHandler = new Handler() { Loading Loading @@ -128,8 +130,9 @@ public class SpellCheckerSession { mSpellCheckerSessionListenerImpl = new SpellCheckerSessionListenerImpl(mHandler); mInternalListener = new InternalListener(mSpellCheckerSessionListenerImpl); mTextServicesManager = tsm; mIsUsed = true; mSpellCheckerSessionListener = listener; mGuard.open("finishSession"); } /** Loading Loading @@ -160,7 +163,7 @@ public class SpellCheckerSession { * checker. */ public void close() { mIsUsed = false; mGuard.close(); try { mSpellCheckerSessionListenerImpl.close(); mTextServicesManager.finishSpellCheckerService(mSpellCheckerSessionListenerImpl); Loading Loading @@ -542,12 +545,15 @@ public class SpellCheckerSession { @Override protected void finalize() throws Throwable { super.finalize(); if (mIsUsed) { Log.e(TAG, "SpellCheckerSession was not finished properly." + "You should call finishSession() when you finished to use a spell checker."); try { // Note that mGuard will be null if the constructor threw. if (mGuard != null) { mGuard.warnIfOpen(); close(); } } finally { super.finalize(); } } /** Loading