Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -47282,7 +47282,7 @@ package android.view.textclassifier { public final class TextClassificationManager { method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence); method public synchronized android.view.textclassifier.TextClassifier getDefaultTextClassifier(); method public android.view.textclassifier.TextClassifier getDefaultTextClassifier(); } public final class TextClassificationResult { api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -50701,7 +50701,7 @@ package android.view.textclassifier { public final class TextClassificationManager { method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence); method public synchronized android.view.textclassifier.TextClassifier getDefaultTextClassifier(); method public android.view.textclassifier.TextClassifier getDefaultTextClassifier(); } public final class TextClassificationResult { api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -47595,7 +47595,7 @@ package android.view.textclassifier { public final class TextClassificationManager { method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence); method public synchronized android.view.textclassifier.TextClassifier getDefaultTextClassifier(); method public android.view.textclassifier.TextClassifier getDefaultTextClassifier(); } public final class TextClassificationResult { core/java/android/view/textclassifier/TextClassificationManager.java +24 −17 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ public final class TextClassificationManager { private static final String LOG_TAG = "TextClassificationManager"; private final Object mTextClassifierLock = new Object(); private final Object mLangIdLock = new Object(); private final Context mContext; // TODO: Implement a way to close the file descriptor. private ParcelFileDescriptor mFd; Loading @@ -55,7 +58,8 @@ public final class TextClassificationManager { /** * Returns the default text classifier. */ public synchronized TextClassifier getDefaultTextClassifier() { public TextClassifier getDefaultTextClassifier() { synchronized (mTextClassifierLock) { if (mDefault == null) { try { mFd = ParcelFileDescriptor.open( Loading @@ -69,6 +73,7 @@ public final class TextClassificationManager { } return mDefault; } } /** * Returns information containing languages that were detected in the provided text. Loading @@ -95,7 +100,8 @@ public final class TextClassificationManager { return Collections.emptyList(); } private synchronized LangId getLanguageDetector() { private LangId getLanguageDetector() { synchronized (mLangIdLock) { if (mLangId == null) { // TODO: Use a file descriptor as soon as we start to depend on a model file // for language detection. Loading @@ -104,3 +110,4 @@ public final class TextClassificationManager { return mLangId; } } } core/java/android/view/textclassifier/TextClassifierImpl.java +8 −4 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ final class TextClassifierImpl implements TextClassifier { private static final String LOG_TAG = "TextClassifierImpl"; private final Object mSmartSelectionLock = new Object(); private final Context mContext; private final ParcelFileDescriptor mFd; private SmartSelection mSmartSelection; Loading Loading @@ -140,12 +142,14 @@ final class TextClassifierImpl implements TextClassifier { return TextClassifier.NO_OP.getLinks(text, linkMask); } private synchronized SmartSelection getSmartSelection() throws FileNotFoundException { private SmartSelection getSmartSelection() throws FileNotFoundException { synchronized (mSmartSelectionLock) { if (mSmartSelection == null) { mSmartSelection = new SmartSelection(mFd.getFd()); } return mSmartSelection; } } private TextClassificationResult createClassificationResult(String type, CharSequence text) { final Intent intent = IntentFactory.create(type, text.toString()); Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -47282,7 +47282,7 @@ package android.view.textclassifier { public final class TextClassificationManager { method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence); method public synchronized android.view.textclassifier.TextClassifier getDefaultTextClassifier(); method public android.view.textclassifier.TextClassifier getDefaultTextClassifier(); } public final class TextClassificationResult {
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -50701,7 +50701,7 @@ package android.view.textclassifier { public final class TextClassificationManager { method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence); method public synchronized android.view.textclassifier.TextClassifier getDefaultTextClassifier(); method public android.view.textclassifier.TextClassifier getDefaultTextClassifier(); } public final class TextClassificationResult {
api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -47595,7 +47595,7 @@ package android.view.textclassifier { public final class TextClassificationManager { method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence); method public synchronized android.view.textclassifier.TextClassifier getDefaultTextClassifier(); method public android.view.textclassifier.TextClassifier getDefaultTextClassifier(); } public final class TextClassificationResult {
core/java/android/view/textclassifier/TextClassificationManager.java +24 −17 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ public final class TextClassificationManager { private static final String LOG_TAG = "TextClassificationManager"; private final Object mTextClassifierLock = new Object(); private final Object mLangIdLock = new Object(); private final Context mContext; // TODO: Implement a way to close the file descriptor. private ParcelFileDescriptor mFd; Loading @@ -55,7 +58,8 @@ public final class TextClassificationManager { /** * Returns the default text classifier. */ public synchronized TextClassifier getDefaultTextClassifier() { public TextClassifier getDefaultTextClassifier() { synchronized (mTextClassifierLock) { if (mDefault == null) { try { mFd = ParcelFileDescriptor.open( Loading @@ -69,6 +73,7 @@ public final class TextClassificationManager { } return mDefault; } } /** * Returns information containing languages that were detected in the provided text. Loading @@ -95,7 +100,8 @@ public final class TextClassificationManager { return Collections.emptyList(); } private synchronized LangId getLanguageDetector() { private LangId getLanguageDetector() { synchronized (mLangIdLock) { if (mLangId == null) { // TODO: Use a file descriptor as soon as we start to depend on a model file // for language detection. Loading @@ -104,3 +110,4 @@ public final class TextClassificationManager { return mLangId; } } }
core/java/android/view/textclassifier/TextClassifierImpl.java +8 −4 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ final class TextClassifierImpl implements TextClassifier { private static final String LOG_TAG = "TextClassifierImpl"; private final Object mSmartSelectionLock = new Object(); private final Context mContext; private final ParcelFileDescriptor mFd; private SmartSelection mSmartSelection; Loading Loading @@ -140,12 +142,14 @@ final class TextClassifierImpl implements TextClassifier { return TextClassifier.NO_OP.getLinks(text, linkMask); } private synchronized SmartSelection getSmartSelection() throws FileNotFoundException { private SmartSelection getSmartSelection() throws FileNotFoundException { synchronized (mSmartSelectionLock) { if (mSmartSelection == null) { mSmartSelection = new SmartSelection(mFd.getFd()); } return mSmartSelection; } } private TextClassificationResult createClassificationResult(String type, CharSequence text) { final Intent intent = IntentFactory.create(type, text.toString()); Loading