Merge "Fix DeadObjectException of the spell checker"
This commit is contained in:
@@ -201,7 +201,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
Settings.Secure.getString(mContext.getContentResolver(),
|
Settings.Secure.getString(mContext.getContentResolver(),
|
||||||
Settings.Secure.SELECTED_SPELL_CHECKER_SUBTYPE);
|
Settings.Secure.SELECTED_SPELL_CHECKER_SUBTYPE);
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Slog.w(TAG, "getCurrentSpellChecker: " + subtypeHashCodeStr);
|
Slog.w(TAG, "getCurrentSpellCheckerSubtype: " + subtypeHashCodeStr);
|
||||||
}
|
}
|
||||||
final SpellCheckerInfo sci = getCurrentSpellChecker(null);
|
final SpellCheckerInfo sci = getCurrentSpellChecker(null);
|
||||||
if (sci == null || sci.getSubtypeCount() == 0) {
|
if (sci == null || sci.getSubtypeCount() == 0) {
|
||||||
@@ -509,7 +509,8 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
listener.mScLocale, listener.mScListener, listener.mBundle);
|
listener.mScLocale, listener.mScListener, listener.mBundle);
|
||||||
listener.mTsListener.onServiceConnected(session);
|
listener.mTsListener.onServiceConnected(session);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "Exception in getting the spell checker session: " + e);
|
Slog.e(TAG, "Exception in getting the spell checker session."
|
||||||
|
+ "Reconnect to the spellchecker. ", e);
|
||||||
removeAll();
|
removeAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -579,8 +580,12 @@ public class TextServicesManagerService extends ITextServicesManager.Stub {
|
|||||||
Slog.d(TAG, "cleanLocked");
|
Slog.d(TAG, "cleanLocked");
|
||||||
}
|
}
|
||||||
if (mListeners.isEmpty()) {
|
if (mListeners.isEmpty()) {
|
||||||
if (mSpellCheckerBindGroups.containsKey(this)) {
|
final String sciId = mInternalConnection.mSciId;
|
||||||
mSpellCheckerBindGroups.remove(this);
|
if (mSpellCheckerBindGroups.containsKey(sciId)) {
|
||||||
|
if (DBG) {
|
||||||
|
Slog.d(TAG, "Remove bind group.");
|
||||||
|
}
|
||||||
|
mSpellCheckerBindGroups.remove(sciId);
|
||||||
}
|
}
|
||||||
// Unbind service when there is no active clients.
|
// Unbind service when there is no active clients.
|
||||||
mContext.unbindService(mInternalConnection);
|
mContext.unbindService(mInternalConnection);
|
||||||
|
|||||||
Reference in New Issue
Block a user