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

Commit c54e1a60 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "TextClassificationManager: Make certain methods thread-safe"

parents aea3ec67 4039454f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public final class TextClassificationManager {
    /**
     * Returns the default text classifier.
     */
    public TextClassifier getDefaultTextClassifier() {
    public synchronized TextClassifier getDefaultTextClassifier() {
        if (mDefault == null) {
            try {
                mFd = ParcelFileDescriptor.open(
@@ -95,7 +95,7 @@ public final class TextClassificationManager {
        return Collections.emptyList();
    }

    private LangId getLanguageDetector() {
    private synchronized LangId getLanguageDetector() {
        if (mLangId == null) {
            // TODO: Use a file descriptor as soon as we start to depend on a model file
            // for language detection.