Loading services/core/java/com/android/server/TextServicesManagerService.java +28 −28 Original line number Diff line number Diff line Loading @@ -187,14 +187,12 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { SpellCheckerInfo sci = getCurrentSpellChecker(null); if (sci == null) { sci = findAvailSystemSpellCheckerLocked(null); if (sci != null) { // Set the current spell checker if there is one or more spell checkers // Set the current spell checker if there is one or more system spell checkers // available. In this case, "sci" is the first one in the available spell // checkers. setCurrentSpellCheckerLocked(sci); } } } void updateCurrentProfileIds() { mSettings.setCurrentProfileIds( Loading @@ -221,9 +219,17 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { SpellCheckerInfo sci = getCurrentSpellChecker(null); buildSpellCheckerMapLocked( mContext, mSpellCheckerList, mSpellCheckerMap, mSettings); // If no spell checker is enabled, just return. The user should explicitly // If spell checker is disabled, just return. The user should explicitly // enable the spell checker. if (sci == null) return; if (!isSpellCheckerEnabledLocked()) return; if (sci == null) { sci = findAvailSystemSpellCheckerLocked(null); // Set the current spell checker if there is one or more system spell checkers // available. In this case, "sci" is the first one in the available spell // checkers. setCurrentSpellCheckerLocked(sci); } else { final String packageName = sci.getPackageName(); final int change = isPackageDisappearing(packageName); if (// Package disappearing Loading @@ -239,6 +245,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { } } } } private final class TextServicesBroadcastReceiver extends BroadcastReceiver { @Override Loading Loading @@ -652,15 +659,14 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { } } private void setCurrentSpellCheckerLocked(SpellCheckerInfo sci) { final String sciId = sci.getId(); private void setCurrentSpellCheckerLocked(@Nullable SpellCheckerInfo sci) { final String sciId = (sci != null) ? sci.getId() : ""; if (DBG) { Slog.w(TAG, "setCurrentSpellChecker: " + sciId); } final long ident = Binder.clearCallingIdentity(); try { mSettings.putSelectedSpellChecker(sciId); setCurrentSpellCheckerSubtypeLocked(0); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -1106,14 +1112,8 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { } public void putSelectedSpellChecker(@Nullable String sciId) { if (TextUtils.isEmpty(sciId)) { // OK to coalesce to null, since getSelectedSpellChecker() can take care of the // empty data scenario. putString(Settings.Secure.SELECTED_SPELL_CHECKER, null); } else { putString(Settings.Secure.SELECTED_SPELL_CHECKER, sciId); } } public void putSelectedSpellCheckerSubtype(int hashCode) { putInt(Settings.Secure.SELECTED_SPELL_CHECKER_SUBTYPE, hashCode); Loading Loading
services/core/java/com/android/server/TextServicesManagerService.java +28 −28 Original line number Diff line number Diff line Loading @@ -187,14 +187,12 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { SpellCheckerInfo sci = getCurrentSpellChecker(null); if (sci == null) { sci = findAvailSystemSpellCheckerLocked(null); if (sci != null) { // Set the current spell checker if there is one or more spell checkers // Set the current spell checker if there is one or more system spell checkers // available. In this case, "sci" is the first one in the available spell // checkers. setCurrentSpellCheckerLocked(sci); } } } void updateCurrentProfileIds() { mSettings.setCurrentProfileIds( Loading @@ -221,9 +219,17 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { SpellCheckerInfo sci = getCurrentSpellChecker(null); buildSpellCheckerMapLocked( mContext, mSpellCheckerList, mSpellCheckerMap, mSettings); // If no spell checker is enabled, just return. The user should explicitly // If spell checker is disabled, just return. The user should explicitly // enable the spell checker. if (sci == null) return; if (!isSpellCheckerEnabledLocked()) return; if (sci == null) { sci = findAvailSystemSpellCheckerLocked(null); // Set the current spell checker if there is one or more system spell checkers // available. In this case, "sci" is the first one in the available spell // checkers. setCurrentSpellCheckerLocked(sci); } else { final String packageName = sci.getPackageName(); final int change = isPackageDisappearing(packageName); if (// Package disappearing Loading @@ -239,6 +245,7 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { } } } } private final class TextServicesBroadcastReceiver extends BroadcastReceiver { @Override Loading Loading @@ -652,15 +659,14 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { } } private void setCurrentSpellCheckerLocked(SpellCheckerInfo sci) { final String sciId = sci.getId(); private void setCurrentSpellCheckerLocked(@Nullable SpellCheckerInfo sci) { final String sciId = (sci != null) ? sci.getId() : ""; if (DBG) { Slog.w(TAG, "setCurrentSpellChecker: " + sciId); } final long ident = Binder.clearCallingIdentity(); try { mSettings.putSelectedSpellChecker(sciId); setCurrentSpellCheckerSubtypeLocked(0); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -1106,14 +1112,8 @@ public class TextServicesManagerService extends ITextServicesManager.Stub { } public void putSelectedSpellChecker(@Nullable String sciId) { if (TextUtils.isEmpty(sciId)) { // OK to coalesce to null, since getSelectedSpellChecker() can take care of the // empty data scenario. putString(Settings.Secure.SELECTED_SPELL_CHECKER, null); } else { putString(Settings.Secure.SELECTED_SPELL_CHECKER, sciId); } } public void putSelectedSpellCheckerSubtype(int hashCode) { putInt(Settings.Secure.SELECTED_SPELL_CHECKER_SUBTYPE, hashCode); Loading