Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c271c97e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Return an empty list instead of null." into sc-dev am: df786ca1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13908126

Change-Id: I0a24e6851337fc159a2b87e71d3d6a8b62121fc2
parents e9f3163f df786ca1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52311,7 +52311,7 @@ package android.view.textservice {
  public final class TextServicesManager {
    method @Nullable public android.view.textservice.SpellCheckerInfo getCurrentSpellCheckerInfo();
    method @Nullable public java.util.List<android.view.textservice.SpellCheckerInfo> getEnabledSpellCheckerInfos();
    method @NonNull public java.util.List<android.view.textservice.SpellCheckerInfo> getEnabledSpellCheckerInfos();
    method public boolean isSpellCheckerEnabled();
    method @Nullable public android.view.textservice.SpellCheckerSession newSpellCheckerSession(@Nullable android.os.Bundle, @Nullable java.util.Locale, @NonNull android.view.textservice.SpellCheckerSession.SpellCheckerSessionListener, boolean);
    method @Nullable public android.view.textservice.SpellCheckerSession newSpellCheckerSession(@Nullable android.os.Bundle, @Nullable java.util.Locale, @NonNull android.view.textservice.SpellCheckerSession.SpellCheckerSessionListener, boolean, int);
+5 −4
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.internal.textservice.ISpellCheckerSessionListener;
import com.android.internal.textservice.ITextServicesManager;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

@@ -288,15 +289,15 @@ public final class TextServicesManager {
    }

    /**
     * Retrieve the list of currently enabled spell checkers, or null if there is none.
     * Retrieve the list of currently enabled spell checkers.
     *
     * @return The list of currently enabled spell checkers.
     */
    @Nullable
    @SuppressLint("NullableCollection")
    @NonNull
    public List<SpellCheckerInfo> getEnabledSpellCheckerInfos() {
        final SpellCheckerInfo[] enabledSpellCheckers = getEnabledSpellCheckers();
        return enabledSpellCheckers != null ? Arrays.asList(enabledSpellCheckers) : null;
        return enabledSpellCheckers != null
                ? Arrays.asList(enabledSpellCheckers) : Collections.emptyList();
    }

    /**