Merge changes from topic 'langdet' into oc-dev
* changes:
Hide TextClassifier.getLinks API.
Hide TextClassificationManager.detectLanguages API
diff --git a/api/current.txt b/api/current.txt
index 698c9b6..0575887 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -48286,12 +48286,7 @@
package android.view.textclassifier {
- public abstract interface LinksInfo {
- method public abstract boolean apply(java.lang.CharSequence);
- }
-
public final class TextClassificationManager {
- method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence);
method public android.view.textclassifier.TextClassifier getTextClassifier();
method public void setTextClassifier(android.view.textclassifier.TextClassifier);
}
@@ -48319,7 +48314,6 @@
}
public abstract interface TextClassifier {
- method public abstract android.view.textclassifier.LinksInfo getLinks(java.lang.CharSequence, int, android.os.LocaleList);
method public abstract android.view.textclassifier.TextClassificationResult getTextClassificationResult(java.lang.CharSequence, int, int, android.os.LocaleList);
method public abstract android.view.textclassifier.TextSelection suggestSelection(java.lang.CharSequence, int, int, android.os.LocaleList);
field public static final android.view.textclassifier.TextClassifier NO_OP;
@@ -48330,20 +48324,6 @@
field public static final java.lang.String TYPE_URL = "url";
}
- public final class TextLanguage {
- method public float getConfidenceScore(java.util.Locale);
- method public int getEndIndex();
- method public java.util.Locale getLanguage(int);
- method public int getLanguageCount();
- method public int getStartIndex();
- }
-
- public static final class TextLanguage.Builder {
- ctor public TextLanguage.Builder(int, int);
- method public android.view.textclassifier.TextLanguage build();
- method public android.view.textclassifier.TextLanguage.Builder setLanguage(java.util.Locale, float);
- }
-
public final class TextSelection {
method public float getConfidenceScore(java.lang.String);
method public java.lang.String getEntity(int);
diff --git a/api/system-current.txt b/api/system-current.txt
index b89964d..a031cc0 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -51867,12 +51867,7 @@
package android.view.textclassifier {
- public abstract interface LinksInfo {
- method public abstract boolean apply(java.lang.CharSequence);
- }
-
public final class TextClassificationManager {
- method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence);
method public android.view.textclassifier.TextClassifier getTextClassifier();
method public void setTextClassifier(android.view.textclassifier.TextClassifier);
}
@@ -51900,7 +51895,6 @@
}
public abstract interface TextClassifier {
- method public abstract android.view.textclassifier.LinksInfo getLinks(java.lang.CharSequence, int, android.os.LocaleList);
method public abstract android.view.textclassifier.TextClassificationResult getTextClassificationResult(java.lang.CharSequence, int, int, android.os.LocaleList);
method public abstract android.view.textclassifier.TextSelection suggestSelection(java.lang.CharSequence, int, int, android.os.LocaleList);
field public static final android.view.textclassifier.TextClassifier NO_OP;
@@ -51911,20 +51905,6 @@
field public static final java.lang.String TYPE_URL = "url";
}
- public final class TextLanguage {
- method public float getConfidenceScore(java.util.Locale);
- method public int getEndIndex();
- method public java.util.Locale getLanguage(int);
- method public int getLanguageCount();
- method public int getStartIndex();
- }
-
- public static final class TextLanguage.Builder {
- ctor public TextLanguage.Builder(int, int);
- method public android.view.textclassifier.TextLanguage build();
- method public android.view.textclassifier.TextLanguage.Builder setLanguage(java.util.Locale, float);
- }
-
public final class TextSelection {
method public float getConfidenceScore(java.lang.String);
method public java.lang.String getEntity(int);
diff --git a/api/test-current.txt b/api/test-current.txt
index 4cafde5..90e0ad3 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -48665,12 +48665,7 @@
package android.view.textclassifier {
- public abstract interface LinksInfo {
- method public abstract boolean apply(java.lang.CharSequence);
- }
-
public final class TextClassificationManager {
- method public java.util.List<android.view.textclassifier.TextLanguage> detectLanguages(java.lang.CharSequence);
method public android.view.textclassifier.TextClassifier getTextClassifier();
method public void setTextClassifier(android.view.textclassifier.TextClassifier);
}
@@ -48698,7 +48693,6 @@
}
public abstract interface TextClassifier {
- method public abstract android.view.textclassifier.LinksInfo getLinks(java.lang.CharSequence, int, android.os.LocaleList);
method public abstract android.view.textclassifier.TextClassificationResult getTextClassificationResult(java.lang.CharSequence, int, int, android.os.LocaleList);
method public abstract android.view.textclassifier.TextSelection suggestSelection(java.lang.CharSequence, int, int, android.os.LocaleList);
field public static final android.view.textclassifier.TextClassifier NO_OP;
@@ -48709,20 +48703,6 @@
field public static final java.lang.String TYPE_URL = "url";
}
- public final class TextLanguage {
- method public float getConfidenceScore(java.util.Locale);
- method public int getEndIndex();
- method public java.util.Locale getLanguage(int);
- method public int getLanguageCount();
- method public int getStartIndex();
- }
-
- public static final class TextLanguage.Builder {
- ctor public TextLanguage.Builder(int, int);
- method public android.view.textclassifier.TextLanguage build();
- method public android.view.textclassifier.TextLanguage.Builder setLanguage(java.util.Locale, float);
- }
-
public final class TextSelection {
method public float getConfidenceScore(java.lang.String);
method public java.lang.String getEntity(int);
diff --git a/core/java/android/view/textclassifier/LinksInfo.java b/core/java/android/view/textclassifier/LinksInfo.java
index 3acbdc0..754c9e9 100644
--- a/core/java/android/view/textclassifier/LinksInfo.java
+++ b/core/java/android/view/textclassifier/LinksInfo.java
@@ -22,6 +22,7 @@
* Link information that can be applied to text. See: {@link #apply(CharSequence)}.
* Typical implementations of this interface will annotate spannable text with e.g
* {@link android.text.style.ClickableSpan}s or other annotations.
+ * @hide
*/
public interface LinksInfo {
diff --git a/core/java/android/view/textclassifier/TextClassificationManager.java b/core/java/android/view/textclassifier/TextClassificationManager.java
index dcdbe57..6b641db 100644
--- a/core/java/android/view/textclassifier/TextClassificationManager.java
+++ b/core/java/android/view/textclassifier/TextClassificationManager.java
@@ -82,6 +82,7 @@
* This is a blocking operation you should avoid calling it on the UI thread.
*
* @throws IllegalArgumentException if text is null
+ * @hide
*/
public List<TextLanguage> detectLanguages(@NonNull CharSequence text) {
Preconditions.checkArgument(text != null);
diff --git a/core/java/android/view/textclassifier/TextClassifier.java b/core/java/android/view/textclassifier/TextClassifier.java
index 0831e20..46fed43 100644
--- a/core/java/android/view/textclassifier/TextClassifier.java
+++ b/core/java/android/view/textclassifier/TextClassifier.java
@@ -132,6 +132,7 @@
* a default locale, or use the system default.
*
* @throws IllegalArgumentException if text is null
+ * @hide
*/
LinksInfo getLinks(
@NonNull CharSequence text, int linkMask, @Nullable LocaleList defaultLocales);
diff --git a/core/java/android/view/textclassifier/TextLanguage.java b/core/java/android/view/textclassifier/TextLanguage.java
index d94d163..209813a 100644
--- a/core/java/android/view/textclassifier/TextLanguage.java
+++ b/core/java/android/view/textclassifier/TextLanguage.java
@@ -28,6 +28,7 @@
/**
* Specifies detected languages for a section of text indicated by a start and end index.
+ * @hide
*/
public final class TextLanguage {