diff options
author | satok <satok@google.com> | 2011-08-25 16:50:11 +0900 |
---|---|---|
committer | satok <satok@google.com> | 2011-08-25 17:08:19 +0900 |
commit | a33c4fc5bed76727f1e06e522e0136101a2304cd (patch) | |
tree | fee8144085f9ea04eabca2152375288161982ebf /core/java | |
parent | 1fc756da434441708eb557a22363eea7f41f3f73 (diff) | |
download | frameworks_base-a33c4fc5bed76727f1e06e522e0136101a2304cd.zip frameworks_base-a33c4fc5bed76727f1e06e522e0136101a2304cd.tar.gz frameworks_base-a33c4fc5bed76727f1e06e522e0136101a2304cd.tar.bz2 |
Add functions to enable / disable spell checker
Bug: 5057977
Change-Id: I2b27bd5f55feb305368034d7e95f83257ac4b3e6
Diffstat (limited to 'core/java')
3 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 15c57e6..be154e6 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3785,6 +3785,13 @@ public final class Settings { "selected_spell_checker_subtype"; /** + * The {@link ComponentName} string whether spell checker is enabled or not. + * + * @hide + */ + public static final String SPELL_CHECKER_ENABLED = "spell_checker_enabled"; + + /** * What happens when the user presses the Power button while in-call * and the screen is on.<br/> * <b>Values:</b><br/> diff --git a/core/java/android/view/textservice/TextServicesManager.java b/core/java/android/view/textservice/TextServicesManager.java index bb13052..5dca348 100644 --- a/core/java/android/view/textservice/TextServicesManager.java +++ b/core/java/android/view/textservice/TextServicesManager.java @@ -170,5 +170,26 @@ public final class TextServicesManager { } } + /** + * @hide + */ + public void setSpellCheckerEnabled(boolean enabled) { + try { + sService.setSpellCheckerEnabled(enabled); + } catch (RemoteException e) { + Log.e(TAG, "Error in setSpellCheckerSubtype:" + e); + } + } + /** + * @hide + */ + public boolean isSpellCheckerEnabled() { + try { + return sService.isSpellCheckerEnabled(); + } catch (RemoteException e) { + Log.e(TAG, "Error in setSpellCheckerSubtype:" + e); + return false; + } + } } diff --git a/core/java/com/android/internal/textservice/ITextServicesManager.aidl b/core/java/com/android/internal/textservice/ITextServicesManager.aidl index cc30c17..b18af02 100644 --- a/core/java/com/android/internal/textservice/ITextServicesManager.aidl +++ b/core/java/com/android/internal/textservice/ITextServicesManager.aidl @@ -37,5 +37,7 @@ interface ITextServicesManager { oneway void finishSpellCheckerService(in ISpellCheckerSessionListener listener); oneway void setCurrentSpellChecker(String locale, String sciId); oneway void setCurrentSpellCheckerSubtype(String locale, int hashCode); + oneway void setSpellCheckerEnabled(boolean enabled); + boolean isSpellCheckerEnabled(); SpellCheckerInfo[] getEnabledSpellCheckers(); } |