Loading apct-tests/perftests/core/src/android/textclassifier/TextClassifierPerfTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class TextClassifierPerfTest { Context context = InstrumentationRegistry.getTargetContext(); TextClassificationManager textClassificationManager = context.getSystemService(TextClassificationManager.class); mTextClassifier = textClassificationManager.getLocalTextClassifier(); mTextClassifier = textClassificationManager.getTextClassifier(TextClassifier.LOCAL); } @Test Loading api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -54238,7 +54238,6 @@ package android.view.textclassifier { public final class TextClassificationManager { method @NonNull public android.view.textclassifier.TextClassifier createTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext); method @NonNull public android.view.textclassifier.TextClassifier getLocalTextClassifier(); method @NonNull public android.view.textclassifier.TextClassifier getTextClassifier(); method public void setTextClassificationSessionFactory(@Nullable android.view.textclassifier.TextClassificationSessionFactory); method public void setTextClassifier(@Nullable android.view.textclassifier.TextClassifier); api/system-current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -6718,7 +6718,8 @@ package android.service.textclassifier { public abstract class TextClassifierService extends android.app.Service { ctor public TextClassifierService(); method public final android.view.textclassifier.TextClassifier getLocalTextClassifier(); method public static android.view.textclassifier.TextClassifier getDefaultTextClassifierImplementation(@NonNull android.content.Context); method @Deprecated public final android.view.textclassifier.TextClassifier getLocalTextClassifier(); method @Nullable public final android.os.IBinder onBind(android.content.Intent); method public abstract void onClassifyText(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextClassification.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextClassification>); method public void onCreateTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext, @NonNull android.view.textclassifier.TextClassificationSessionId); Loading core/java/android/service/textclassifier/TextClassifierService.java +13 −1 Original line number Diff line number Diff line Loading @@ -420,9 +420,21 @@ public abstract class TextClassifierService extends Service { /** * Returns a TextClassifier that runs in this service's process. * If the local TextClassifier is disabled, this returns {@link TextClassifier#NO_OP}. * * @deprecated Use {@link #getDefaultTextClassifierImplementation(Context)} instead. */ @Deprecated public final TextClassifier getLocalTextClassifier() { final TextClassificationManager tcm = getSystemService(TextClassificationManager.class); // Deprecated: In the future, we may not guarantee that this runs in the service's process. return getDefaultTextClassifierImplementation(this); } /** * Returns the platform's default TextClassifier implementation. */ public static TextClassifier getDefaultTextClassifierImplementation(@NonNull Context context) { final TextClassificationManager tcm = context.getSystemService(TextClassificationManager.class); if (tcm != null) { return tcm.getTextClassifier(TextClassifier.LOCAL); } Loading core/java/android/view/textclassifier/TextClassificationManager.java +3 −9 Original line number Diff line number Diff line Loading @@ -75,14 +75,10 @@ public final class TextClassificationManager { * If this is null, this method returns a default text classifier (i.e. either the system text * classifier if one exists, or a local text classifier running in this process.) * <p> * Note that if system textclassifier is in use, requests will be sent to a textclassifier * package provided from OEM. If you want to make sure the requests are handled in your own * process, you should consider {@link #getLocalTextClassifier()} instead. However, the local * textclassifier may return inferior results to those returned by the system * textclassifier. * Note that requests to the TextClassifier may be handled in an OEM-provided process rather * than in the calling app's process. * * @see #setTextClassifier(TextClassifier) * @see #getLocalTextClassifier() */ @NonNull public TextClassifier getTextClassifier() { Loading Loading @@ -224,11 +220,9 @@ public final class TextClassificationManager { /** * Returns a local textclassifier, which is running in this process. * * @see #getTextClassifier() */ @NonNull public TextClassifier getLocalTextClassifier() { private TextClassifier getLocalTextClassifier() { synchronized (mLock) { if (mLocalTextClassifier == null) { if (getSettings().isLocalTextClassifierEnabled()) { Loading Loading
apct-tests/perftests/core/src/android/textclassifier/TextClassifierPerfTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class TextClassifierPerfTest { Context context = InstrumentationRegistry.getTargetContext(); TextClassificationManager textClassificationManager = context.getSystemService(TextClassificationManager.class); mTextClassifier = textClassificationManager.getLocalTextClassifier(); mTextClassifier = textClassificationManager.getTextClassifier(TextClassifier.LOCAL); } @Test Loading
api/current.txt +0 −1 Original line number Diff line number Diff line Loading @@ -54238,7 +54238,6 @@ package android.view.textclassifier { public final class TextClassificationManager { method @NonNull public android.view.textclassifier.TextClassifier createTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext); method @NonNull public android.view.textclassifier.TextClassifier getLocalTextClassifier(); method @NonNull public android.view.textclassifier.TextClassifier getTextClassifier(); method public void setTextClassificationSessionFactory(@Nullable android.view.textclassifier.TextClassificationSessionFactory); method public void setTextClassifier(@Nullable android.view.textclassifier.TextClassifier);
api/system-current.txt +2 −1 Original line number Diff line number Diff line Loading @@ -6718,7 +6718,8 @@ package android.service.textclassifier { public abstract class TextClassifierService extends android.app.Service { ctor public TextClassifierService(); method public final android.view.textclassifier.TextClassifier getLocalTextClassifier(); method public static android.view.textclassifier.TextClassifier getDefaultTextClassifierImplementation(@NonNull android.content.Context); method @Deprecated public final android.view.textclassifier.TextClassifier getLocalTextClassifier(); method @Nullable public final android.os.IBinder onBind(android.content.Intent); method public abstract void onClassifyText(@Nullable android.view.textclassifier.TextClassificationSessionId, @NonNull android.view.textclassifier.TextClassification.Request, @NonNull android.os.CancellationSignal, @NonNull android.service.textclassifier.TextClassifierService.Callback<android.view.textclassifier.TextClassification>); method public void onCreateTextClassificationSession(@NonNull android.view.textclassifier.TextClassificationContext, @NonNull android.view.textclassifier.TextClassificationSessionId); Loading
core/java/android/service/textclassifier/TextClassifierService.java +13 −1 Original line number Diff line number Diff line Loading @@ -420,9 +420,21 @@ public abstract class TextClassifierService extends Service { /** * Returns a TextClassifier that runs in this service's process. * If the local TextClassifier is disabled, this returns {@link TextClassifier#NO_OP}. * * @deprecated Use {@link #getDefaultTextClassifierImplementation(Context)} instead. */ @Deprecated public final TextClassifier getLocalTextClassifier() { final TextClassificationManager tcm = getSystemService(TextClassificationManager.class); // Deprecated: In the future, we may not guarantee that this runs in the service's process. return getDefaultTextClassifierImplementation(this); } /** * Returns the platform's default TextClassifier implementation. */ public static TextClassifier getDefaultTextClassifierImplementation(@NonNull Context context) { final TextClassificationManager tcm = context.getSystemService(TextClassificationManager.class); if (tcm != null) { return tcm.getTextClassifier(TextClassifier.LOCAL); } Loading
core/java/android/view/textclassifier/TextClassificationManager.java +3 −9 Original line number Diff line number Diff line Loading @@ -75,14 +75,10 @@ public final class TextClassificationManager { * If this is null, this method returns a default text classifier (i.e. either the system text * classifier if one exists, or a local text classifier running in this process.) * <p> * Note that if system textclassifier is in use, requests will be sent to a textclassifier * package provided from OEM. If you want to make sure the requests are handled in your own * process, you should consider {@link #getLocalTextClassifier()} instead. However, the local * textclassifier may return inferior results to those returned by the system * textclassifier. * Note that requests to the TextClassifier may be handled in an OEM-provided process rather * than in the calling app's process. * * @see #setTextClassifier(TextClassifier) * @see #getLocalTextClassifier() */ @NonNull public TextClassifier getTextClassifier() { Loading Loading @@ -224,11 +220,9 @@ public final class TextClassificationManager { /** * Returns a local textclassifier, which is running in this process. * * @see #getTextClassifier() */ @NonNull public TextClassifier getLocalTextClassifier() { private TextClassifier getLocalTextClassifier() { synchronized (mLock) { if (mLocalTextClassifier == null) { if (getSettings().isLocalTextClassifierEnabled()) { Loading