Loading core/java/android/view/textservice/TextServicesManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.CallbackExecutor; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemService; import android.annotation.UserHandleAware; import android.annotation.UserIdInt; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; Loading Loading @@ -114,6 +115,7 @@ public final class TextServicesManager { * @throws ServiceNotFoundException When {@link TextServicesManager} is not available. * @hide */ @UserHandleAware @NonNull public static TextServicesManager createInstance(@NonNull Context context) throws ServiceNotFoundException { Loading Loading @@ -178,6 +180,7 @@ public final class TextServicesManager { * languages in settings will be returned. * @return a spell checker session of the spell checker */ @UserHandleAware @Nullable public SpellCheckerSession newSpellCheckerSession(@Nullable Bundle bundle, @Nullable Locale locale, Loading Loading @@ -208,6 +211,7 @@ public final class TextServicesManager { * @param listener a spell checker session lister for getting results from the spell checker. * @return The spell checker session of the spell checker. */ @UserHandleAware @Nullable public SpellCheckerSession newSpellCheckerSession( @NonNull SpellCheckerSessionParams params, Loading Loading @@ -283,6 +287,7 @@ public final class TextServicesManager { */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553, publicAlternatives = "Use {@link #getEnabledSpellCheckerInfos()} instead.") @UserHandleAware public SpellCheckerInfo[] getEnabledSpellCheckers() { try { final SpellCheckerInfo[] retval = mService.getEnabledSpellCheckers(mUserId); Loading @@ -300,6 +305,7 @@ public final class TextServicesManager { * * @return The list of currently enabled spell checkers. */ @UserHandleAware @NonNull public List<SpellCheckerInfo> getEnabledSpellCheckerInfos() { final SpellCheckerInfo[] enabledSpellCheckers = getEnabledSpellCheckers(); Loading @@ -312,6 +318,7 @@ public final class TextServicesManager { * * @return The current active spell checker info. */ @UserHandleAware @Nullable public SpellCheckerInfo getCurrentSpellCheckerInfo() { try { Loading @@ -328,6 +335,7 @@ public final class TextServicesManager { */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, publicAlternatives = "Use {@link #getCurrentSpellCheckerInfo()} instead.") @UserHandleAware @Nullable public SpellCheckerInfo getCurrentSpellChecker() { return getCurrentSpellCheckerInfo(); Loading @@ -343,6 +351,7 @@ public final class TextServicesManager { * @hide */ @UnsupportedAppUsage @UserHandleAware @Nullable public SpellCheckerSubtype getCurrentSpellCheckerSubtype( boolean allowImplicitlySelectedSubtype) { Loading @@ -358,6 +367,7 @@ public final class TextServicesManager { * * @return {@code true} if spell checker is enabled, {@code false} otherwise. */ @UserHandleAware public boolean isSpellCheckerEnabled() { try { return mService.isSpellCheckerEnabled(mUserId); Loading @@ -366,6 +376,7 @@ public final class TextServicesManager { } } @UserHandleAware void finishSpellCheckerService(ISpellCheckerSessionListener listener) { try { mService.finishSpellCheckerService(mUserId, listener); Loading Loading
core/java/android/view/textservice/TextServicesManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.CallbackExecutor; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemService; import android.annotation.UserHandleAware; import android.annotation.UserIdInt; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; Loading Loading @@ -114,6 +115,7 @@ public final class TextServicesManager { * @throws ServiceNotFoundException When {@link TextServicesManager} is not available. * @hide */ @UserHandleAware @NonNull public static TextServicesManager createInstance(@NonNull Context context) throws ServiceNotFoundException { Loading Loading @@ -178,6 +180,7 @@ public final class TextServicesManager { * languages in settings will be returned. * @return a spell checker session of the spell checker */ @UserHandleAware @Nullable public SpellCheckerSession newSpellCheckerSession(@Nullable Bundle bundle, @Nullable Locale locale, Loading Loading @@ -208,6 +211,7 @@ public final class TextServicesManager { * @param listener a spell checker session lister for getting results from the spell checker. * @return The spell checker session of the spell checker. */ @UserHandleAware @Nullable public SpellCheckerSession newSpellCheckerSession( @NonNull SpellCheckerSessionParams params, Loading Loading @@ -283,6 +287,7 @@ public final class TextServicesManager { */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553, publicAlternatives = "Use {@link #getEnabledSpellCheckerInfos()} instead.") @UserHandleAware public SpellCheckerInfo[] getEnabledSpellCheckers() { try { final SpellCheckerInfo[] retval = mService.getEnabledSpellCheckers(mUserId); Loading @@ -300,6 +305,7 @@ public final class TextServicesManager { * * @return The list of currently enabled spell checkers. */ @UserHandleAware @NonNull public List<SpellCheckerInfo> getEnabledSpellCheckerInfos() { final SpellCheckerInfo[] enabledSpellCheckers = getEnabledSpellCheckers(); Loading @@ -312,6 +318,7 @@ public final class TextServicesManager { * * @return The current active spell checker info. */ @UserHandleAware @Nullable public SpellCheckerInfo getCurrentSpellCheckerInfo() { try { Loading @@ -328,6 +335,7 @@ public final class TextServicesManager { */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, publicAlternatives = "Use {@link #getCurrentSpellCheckerInfo()} instead.") @UserHandleAware @Nullable public SpellCheckerInfo getCurrentSpellChecker() { return getCurrentSpellCheckerInfo(); Loading @@ -343,6 +351,7 @@ public final class TextServicesManager { * @hide */ @UnsupportedAppUsage @UserHandleAware @Nullable public SpellCheckerSubtype getCurrentSpellCheckerSubtype( boolean allowImplicitlySelectedSubtype) { Loading @@ -358,6 +367,7 @@ public final class TextServicesManager { * * @return {@code true} if spell checker is enabled, {@code false} otherwise. */ @UserHandleAware public boolean isSpellCheckerEnabled() { try { return mService.isSpellCheckerEnabled(mUserId); Loading @@ -366,6 +376,7 @@ public final class TextServicesManager { } } @UserHandleAware void finishSpellCheckerService(ISpellCheckerSessionListener listener) { try { mService.finishSpellCheckerService(mUserId, listener); Loading