Add @UnsupportedAppUsage annotations
For packages:
android.text.util
android.text.style
android.text.method
android.text.format
android.text
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I5be178ad05f2ff98bcf31e24cd4eb33961887c38
Merged-In: I9afbd4ca8826c37cb70db43252e39b9a674e5ae0
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index d1217ae..c053fa0 100644
--- a/config/hiddenapi-light-greylist.txt
+++ b/config/hiddenapi-light-greylist.txt
@@ -4422,160 +4422,6 @@
Landroid/telephony/TelephonyManager;->setSimStateForPhone(ILjava/lang/String;)V
Landroid/telephony/TelephonyManager;->setTelephonyProperty(ILjava/lang/String;Ljava/lang/String;)V
Landroid/telephony/VoLteServiceState;-><init>(I)V
-Landroid/text/AndroidBidi;->bidi(I[C[B)I
-Landroid/text/BoringLayout;->isBoring(Ljava/lang/CharSequence;Landroid/text/TextPaint;Landroid/text/TextDirectionHeuristic;Landroid/text/BoringLayout$Metrics;)Landroid/text/BoringLayout$Metrics;
-Landroid/text/DynamicLayout;-><init>(Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/text/TextPaint;ILandroid/text/Layout$Alignment;Landroid/text/TextDirectionHeuristic;FFZIIILandroid/text/TextUtils$TruncateAt;I)V
-Landroid/text/DynamicLayout;->getBlockEndLines()[I
-Landroid/text/DynamicLayout;->getBlockIndices()[I
-Landroid/text/DynamicLayout;->getIndexFirstChangedBlock()I
-Landroid/text/DynamicLayout;->getNumberOfBlocks()I
-Landroid/text/DynamicLayout;->setIndexFirstChangedBlock(I)V
-Landroid/text/DynamicLayout;->sStaticLayout:Landroid/text/StaticLayout;
-Landroid/text/FontConfig$Family;->getFonts()[Landroid/text/FontConfig$Font;
-Landroid/text/FontConfig$Family;->getName()Ljava/lang/String;
-Landroid/text/FontConfig$Family;->getVariant()I
-Landroid/text/FontConfig$Font;->getAxes()[Landroid/graphics/fonts/FontVariationAxis;
-Landroid/text/FontConfig$Font;->getTtcIndex()I
-Landroid/text/FontConfig$Font;->getWeight()I
-Landroid/text/FontConfig$Font;->isItalic()Z
-Landroid/text/FontConfig;->getFamilies()[Landroid/text/FontConfig$Family;
-Landroid/text/format/DateFormat;->getTimeFormatString(Landroid/content/Context;)Ljava/lang/String;
-Landroid/text/format/DateFormat;->getTimeFormatString(Landroid/content/Context;I)Ljava/lang/String;
-Landroid/text/format/DateFormat;->hasDesignator(Ljava/lang/CharSequence;C)Z
-Landroid/text/format/DateFormat;->hasSeconds(Ljava/lang/CharSequence;)Z
-Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;I)Z
-Landroid/text/format/DateUtils;->formatDuration(J)Ljava/lang/CharSequence;
-Landroid/text/format/DateUtils;->formatDuration(JI)Ljava/lang/CharSequence;
-Landroid/text/format/Formatter;->formatBytes(Landroid/content/res/Resources;JI)Landroid/text/format/Formatter$BytesResult;
-Landroid/text/format/Formatter;->formatShortElapsedTime(Landroid/content/Context;J)Ljava/lang/String;
-Landroid/text/format/Formatter;->formatShortElapsedTimeRoundingUpToMinutes(Landroid/content/Context;J)Ljava/lang/String;
-Landroid/text/Html;->withinStyle(Ljava/lang/StringBuilder;Ljava/lang/CharSequence;II)V
-Landroid/text/InputFilter$LengthFilter;->mMax:I
-Landroid/text/Layout$Alignment;->ALIGN_LEFT:Landroid/text/Layout$Alignment;
-Landroid/text/Layout$Alignment;->ALIGN_RIGHT:Landroid/text/Layout$Alignment;
-Landroid/text/Layout;->DIRS_ALL_LEFT_TO_RIGHT:Landroid/text/Layout$Directions;
-Landroid/text/Layout;->DIRS_ALL_RIGHT_TO_LEFT:Landroid/text/Layout$Directions;
-Landroid/text/Layout;->DIR_REQUEST_DEFAULT_LTR:I
-Landroid/text/Layout;->drawBackground(Landroid/graphics/Canvas;Landroid/graphics/Path;Landroid/graphics/Paint;III)V
-Landroid/text/Layout;->drawText(Landroid/graphics/Canvas;II)V
-Landroid/text/Layout;->getLineRangeForDraw(Landroid/graphics/Canvas;)J
-Landroid/text/Layout;->getPrimaryHorizontal(IZ)F
-Landroid/text/Layout;->getSecondaryHorizontal(IZ)F
-Landroid/text/Layout;->isLevelBoundary(I)Z
-Landroid/text/Layout;->mPaint:Landroid/text/TextPaint;
-Landroid/text/Layout;->shouldClampCursor(I)Z
-Landroid/text/method/AllCapsTransformationMethod;-><init>(Landroid/content/Context;)V
-Landroid/text/method/HideReturnsTransformationMethod;->sInstance:Landroid/text/method/HideReturnsTransformationMethod;
-Landroid/text/method/LinkMovementMethod;->sInstance:Landroid/text/method/LinkMovementMethod;
-Landroid/text/method/MetaKeyKeyListener;->startSelecting(Landroid/view/View;Landroid/text/Spannable;)V
-Landroid/text/method/MetaKeyKeyListener;->stopSelecting(Landroid/view/View;Landroid/text/Spannable;)V
-Landroid/text/method/PasswordTransformationMethod;->DOT:C
-Landroid/text/method/PasswordTransformationMethod;->sInstance:Landroid/text/method/PasswordTransformationMethod;
-Landroid/text/method/TransformationMethod2;->setLengthChangesAllowed(Z)V
-Landroid/text/method/WordIterator;-><init>(Ljava/util/Locale;)V
-Landroid/text/method/WordIterator;->following(I)I
-Landroid/text/method/WordIterator;->getBeginning(I)I
-Landroid/text/method/WordIterator;->getEnd(I)I
-Landroid/text/method/WordIterator;->getNextWordEndOnTwoWordBoundary(I)I
-Landroid/text/method/WordIterator;->getPrevWordBeginningOnTwoWordsBoundary(I)I
-Landroid/text/method/WordIterator;->getPunctuationBeginning(I)I
-Landroid/text/method/WordIterator;->getPunctuationEnd(I)I
-Landroid/text/method/WordIterator;->isAfterPunctuation(I)Z
-Landroid/text/method/WordIterator;->isBoundary(I)Z
-Landroid/text/method/WordIterator;->isOnPunctuation(I)Z
-Landroid/text/method/WordIterator;->nextBoundary(I)I
-Landroid/text/method/WordIterator;->preceding(I)I
-Landroid/text/method/WordIterator;->prevBoundary(I)I
-Landroid/text/method/WordIterator;->setCharSequence(Ljava/lang/CharSequence;II)V
-Landroid/text/Selection;->moveToFollowing(Landroid/text/Spannable;Landroid/text/Selection$PositionIterator;Z)Z
-Landroid/text/Selection;->moveToPreceding(Landroid/text/Spannable;Landroid/text/Selection$PositionIterator;Z)Z
-Landroid/text/SpannableStringBuilder;->getSpans(IILjava/lang/Class;Z)[Ljava/lang/Object;
-Landroid/text/SpannableStringBuilder;->mGapLength:I
-Landroid/text/SpannableStringBuilder;->mGapStart:I
-Landroid/text/SpannableStringBuilder;->mSpanCount:I
-Landroid/text/SpannableStringBuilder;->mSpanEnds:[I
-Landroid/text/SpannableStringBuilder;->mSpanFlags:[I
-Landroid/text/SpannableStringBuilder;->mSpans:[Ljava/lang/Object;
-Landroid/text/SpannableStringBuilder;->mSpanStarts:[I
-Landroid/text/SpannableStringBuilder;->mText:[C
-Landroid/text/SpannableStringBuilder;->sendToSpanWatchers(III)V
-Landroid/text/SpannableStringBuilder;->substring(II)Ljava/lang/String;
-Landroid/text/SpannableStringInternal;-><init>(Ljava/lang/CharSequence;II)V
-Landroid/text/SpannableStringInternal;->checkRange(Ljava/lang/String;II)V
-Landroid/text/SpannableStringInternal;->COLUMNS:I
-Landroid/text/SpannableStringInternal;->copySpans(Landroid/text/SpannableStringInternal;II)V
-Landroid/text/SpannableStringInternal;->copySpans(Landroid/text/Spanned;II)V
-Landroid/text/SpannableStringInternal;->EMPTY:[Ljava/lang/Object;
-Landroid/text/SpannableStringInternal;->END:I
-Landroid/text/SpannableStringInternal;->FLAGS:I
-Landroid/text/SpannableStringInternal;->getSpanEnd(Ljava/lang/Object;)I
-Landroid/text/SpannableStringInternal;->getSpanFlags(Ljava/lang/Object;)I
-Landroid/text/SpannableStringInternal;->getSpans(IILjava/lang/Class;)[Ljava/lang/Object;
-Landroid/text/SpannableStringInternal;->getSpanStart(Ljava/lang/Object;)I
-Landroid/text/SpannableStringInternal;->isIndexFollowsNextLine(I)Z
-Landroid/text/SpannableStringInternal;->isOutOfCopyRange(IIII)Z
-Landroid/text/SpannableStringInternal;->mSpanCount:I
-Landroid/text/SpannableStringInternal;->mSpanData:[I
-Landroid/text/SpannableStringInternal;->mSpans:[Ljava/lang/Object;
-Landroid/text/SpannableStringInternal;->mText:Ljava/lang/String;
-Landroid/text/SpannableStringInternal;->nextSpanTransition(IILjava/lang/Class;)I
-Landroid/text/SpannableStringInternal;->region(II)Ljava/lang/String;
-Landroid/text/SpannableStringInternal;->removeSpan(Ljava/lang/Object;)V
-Landroid/text/SpannableStringInternal;->sendSpanAdded(Ljava/lang/Object;II)V
-Landroid/text/SpannableStringInternal;->sendSpanChanged(Ljava/lang/Object;IIII)V
-Landroid/text/SpannableStringInternal;->sendSpanRemoved(Ljava/lang/Object;II)V
-Landroid/text/SpannableStringInternal;->setSpan(Ljava/lang/Object;III)V
-Landroid/text/SpannableStringInternal;->setSpan(Ljava/lang/Object;IIIZ)V
-Landroid/text/SpannableStringInternal;->START:I
-Landroid/text/SpanSet;->spans:[Ljava/lang/Object;
-Landroid/text/StaticLayout$LineBreaks;->ascents:[F
-Landroid/text/StaticLayout$LineBreaks;->breaks:[I
-Landroid/text/StaticLayout$LineBreaks;->descents:[F
-Landroid/text/StaticLayout$LineBreaks;->flags:[I
-Landroid/text/StaticLayout$LineBreaks;->widths:[F
-Landroid/text/StaticLayout;-><init>(Ljava/lang/CharSequence;IILandroid/text/TextPaint;ILandroid/text/Layout$Alignment;Landroid/text/TextDirectionHeuristic;FFZLandroid/text/TextUtils$TruncateAt;II)V
-Landroid/text/StaticLayout;->ELLIPSIS_START:I
-Landroid/text/StaticLayout;->getHeight(Z)I
-Landroid/text/StaticLayout;->mColumns:I
-Landroid/text/StaticLayout;->mLineCount:I
-Landroid/text/StaticLayout;->mLineDirections:[Landroid/text/Layout$Directions;
-Landroid/text/StaticLayout;->mLines:[I
-Landroid/text/StaticLayout;->mMaximumVisibleLineCount:I
-Landroid/text/style/BulletSpan;->mColor:I
-Landroid/text/style/BulletSpan;->mGapWidth:I
-Landroid/text/style/BulletSpan;->mWantColor:Z
-Landroid/text/style/DynamicDrawableSpan;->mDrawableRef:Ljava/lang/ref/WeakReference;
-Landroid/text/style/EasyEditSpan;->getPendingIntent()Landroid/app/PendingIntent;
-Landroid/text/style/EasyEditSpan;->isDeleteEnabled()Z
-Landroid/text/style/EasyEditSpan;->setDeleteEnabled(Z)V
-Landroid/text/style/ImageSpan;->mDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/text/style/SpellCheckSpan;-><init>()V
-Landroid/text/style/SpellCheckSpan;-><init>(Landroid/os/Parcel;)V
-Landroid/text/style/SpellCheckSpan;->isSpellCheckInProgress()Z
-Landroid/text/style/SpellCheckSpan;->setSpellCheckInProgress(Z)V
-Landroid/text/style/SuggestionRangeSpan;-><init>()V
-Landroid/text/style/SuggestionRangeSpan;-><init>(Landroid/os/Parcel;)V
-Landroid/text/style/SuggestionRangeSpan;->setBackgroundColor(I)V
-Landroid/text/style/SuggestionSpan;->getNotificationTargetClassName()Ljava/lang/String;
-Landroid/text/style/SuggestionSpan;->getUnderlineColor()I
-Landroid/text/style/SuggestionSpan;->mEasyCorrectUnderlineColor:I
-Landroid/text/style/SuggestionSpan;->mEasyCorrectUnderlineThickness:F
-Landroid/text/style/SuggestionSpan;->notifySelection(Landroid/content/Context;Ljava/lang/String;I)V
-Landroid/text/TextLine;->mCharacterStyleSpanSet:Landroid/text/SpanSet;
-Landroid/text/TextLine;->mMetricAffectingSpanSpanSet:Landroid/text/SpanSet;
-Landroid/text/TextLine;->mReplacementSpanSpanSet:Landroid/text/SpanSet;
-Landroid/text/TextLine;->mSpanned:Landroid/text/Spanned;
-Landroid/text/TextLine;->mText:Ljava/lang/CharSequence;
-Landroid/text/TextLine;->obtain()Landroid/text/TextLine;
-Landroid/text/TextLine;->sCached:[Landroid/text/TextLine;
-Landroid/text/TextPaint;->setUnderlineText(IF)V
-Landroid/text/TextPaint;->underlineColor:I
-Landroid/text/TextPaint;->underlineThickness:F
-Landroid/text/TextUtils$TruncateAt;->END_SMALL:Landroid/text/TextUtils$TruncateAt;
-Landroid/text/TextUtils;->packRangeInLong(II)J
-Landroid/text/TextUtils;->unpackRangeEndFromLong(J)I
-Landroid/text/TextUtils;->unpackRangeStartFromLong(J)I
-Landroid/text/util/Linkify;->gatherTelLinks(Ljava/util/ArrayList;Landroid/text/Spannable;Landroid/content/Context;)V
Landroid/transition/ChangeBounds;->BOTTOM_RIGHT_ONLY_PROPERTY:Landroid/util/Property;
Landroid/transition/ChangeBounds;->POSITION_PROPERTY:Landroid/util/Property;
Landroid/transition/Scene;->mEnterAction:Ljava/lang/Runnable;
diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt
index 9cc8f71..7ebfd79 100644
--- a/config/hiddenapi-vendor-list.txt
+++ b/config/hiddenapi-vendor-list.txt
@@ -466,7 +466,6 @@
Landroid/telephony/TelephonyManager;->nvResetConfig(I)Z
Landroid/telephony/TelephonyManager;->putIntAtIndex(Landroid/content/ContentResolver;Ljava/lang/String;II)Z
Landroid/telephony/TelephonyManager;->setPreferredNetworkType(II)Z
-Landroid/text/TextUtils;->isPrintableAsciiOnly(Ljava/lang/CharSequence;)Z
Landroid/view/AppTransitionAnimationSpec;-><init>(ILandroid/graphics/GraphicBuffer;Landroid/graphics/Rect;)V
Landroid/view/BatchedInputEventReceiver;-><init>(Landroid/view/InputChannel;Landroid/os/Looper;Landroid/view/Choreographer;)V
Landroid/view/Choreographer;->getSfInstance()Landroid/view/Choreographer;
diff --git a/core/java/android/text/AndroidBidi.java b/core/java/android/text/AndroidBidi.java
index 72383cf..bb7fb44 100644
--- a/core/java/android/text/AndroidBidi.java
+++ b/core/java/android/text/AndroidBidi.java
@@ -16,6 +16,7 @@
package android.text;
+import android.annotation.UnsupportedAppUsage;
import android.icu.lang.UCharacter;
import android.icu.lang.UCharacterDirection;
import android.icu.lang.UProperty;
@@ -61,6 +62,7 @@
/**
* Runs the bidi algorithm on input text.
*/
+ @UnsupportedAppUsage
public static int bidi(int dir, char[] chs, byte[] chInfo) {
if (chs == null || chInfo == null) {
throw new NullPointerException();
diff --git a/core/java/android/text/BoringLayout.java b/core/java/android/text/BoringLayout.java
index ce38ebb..29f231a 100644
--- a/core/java/android/text/BoringLayout.java
+++ b/core/java/android/text/BoringLayout.java
@@ -16,6 +16,7 @@
package android.text;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
@@ -320,6 +321,7 @@
* if boring.
* @hide
*/
+ @UnsupportedAppUsage
public static Metrics isBoring(CharSequence text, TextPaint paint,
TextDirectionHeuristic textDir, Metrics metrics) {
final int textLength = text.length();
diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java
index febca7e..c46c831 100644
--- a/core/java/android/text/DynamicLayout.java
+++ b/core/java/android/text/DynamicLayout.java
@@ -20,6 +20,7 @@
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Paint;
import android.graphics.Rect;
import android.text.style.ReplacementSpan;
@@ -353,6 +354,7 @@
* @deprecated Use {@link Builder} instead.
*/
@Deprecated
+ @UnsupportedAppUsage
public DynamicLayout(@NonNull CharSequence base, @NonNull CharSequence display,
@NonNull TextPaint paint,
@IntRange(from = 0) int width,
@@ -944,6 +946,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public int[] getBlockEndLines() {
return mBlockEndLines;
}
@@ -951,6 +954,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public int[] getBlockIndices() {
return mBlockIndices;
}
@@ -973,6 +977,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public int getNumberOfBlocks() {
return mNumberOfBlocks;
}
@@ -980,6 +985,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public int getIndexFirstChangedBlock() {
return mIndexFirstChangedBlock;
}
@@ -987,6 +993,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public void setIndexFirstChangedBlock(int i) {
mIndexFirstChangedBlock = i;
}
@@ -1169,6 +1176,7 @@
private Rect mTempRect = new Rect();
+ @UnsupportedAppUsage
private static StaticLayout sStaticLayout = null;
private static StaticLayout.Builder sBuilder = null;
diff --git a/core/java/android/text/FontConfig.java b/core/java/android/text/FontConfig.java
index 7386e3e..9e0fee33 100644
--- a/core/java/android/text/FontConfig.java
+++ b/core/java/android/text/FontConfig.java
@@ -21,6 +21,7 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.fonts.FontVariationAxis;
import android.net.Uri;
@@ -43,6 +44,7 @@
/**
* Returns the ordered list of families included in the system fonts.
*/
+ @UnsupportedAppUsage
public @NonNull Family[] getFamilies() {
return mFamilies;
}
@@ -89,6 +91,7 @@
/**
* Returns the index to be used to access this font when accessing a TTC file.
*/
+ @UnsupportedAppUsage
public int getTtcIndex() {
return mTtcIndex;
}
@@ -96,6 +99,7 @@
/**
* Returns the list of axes associated to this font.
*/
+ @UnsupportedAppUsage
public @NonNull FontVariationAxis[] getAxes() {
return mAxes;
}
@@ -103,6 +107,7 @@
/**
* Returns the weight value for this font.
*/
+ @UnsupportedAppUsage
public int getWeight() {
return mWeight;
}
@@ -110,6 +115,7 @@
/**
* Returns whether this font is italic.
*/
+ @UnsupportedAppUsage
public boolean isItalic() {
return mIsItalic;
}
@@ -224,6 +230,7 @@
/**
* Returns the name given by the system to this font family.
*/
+ @UnsupportedAppUsage
public @Nullable String getName() {
return mName;
}
@@ -231,6 +238,7 @@
/**
* Returns the list of fonts included in this family.
*/
+ @UnsupportedAppUsage
public @Nullable Font[] getFonts() {
return mFonts;
}
@@ -245,6 +253,7 @@
/**
* Returns the font variant for this family, e.g. "elegant" or "compact". May be null.
*/
+ @UnsupportedAppUsage
public @Variant int getVariant() {
return mVariant;
}
diff --git a/core/java/android/text/Html.java b/core/java/android/text/Html.java
index c3aac74..18f8db2 100644
--- a/core/java/android/text/Html.java
+++ b/core/java/android/text/Html.java
@@ -16,6 +16,7 @@
package android.text;
+import android.annotation.UnsupportedAppUsage;
import android.app.ActivityThread;
import android.app.Application;
import android.content.res.Resources;
@@ -628,6 +629,7 @@
}
}
+ @UnsupportedAppUsage
private static void withinStyle(StringBuilder out, CharSequence text,
int start, int end) {
for (int i = start; i < end; i++) {
diff --git a/core/java/android/text/InputFilter.java b/core/java/android/text/InputFilter.java
index a507f2b..a9a7b2f 100644
--- a/core/java/android/text/InputFilter.java
+++ b/core/java/android/text/InputFilter.java
@@ -17,6 +17,7 @@
package android.text;
import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
import com.android.internal.util.Preconditions;
@@ -164,6 +165,7 @@
* greater than the specified length.
*/
public static class LengthFilter implements InputFilter {
+ @UnsupportedAppUsage
private final int mMax;
public LengthFilter(int max) {
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index 09af85d..3afa325 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -18,6 +18,7 @@
import android.annotation.IntDef;
import android.annotation.IntRange;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
@@ -411,6 +412,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public void drawText(Canvas canvas, int firstLine, int lastLine) {
int previousLineBottom = getLineTop(firstLine);
int previousLineEnd = getLineStart(firstLine);
@@ -576,6 +578,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public void drawBackground(Canvas canvas, Path highlight, Paint highlightPaint,
int cursorOffsetVertical, int firstLine, int lastLine) {
// First, draw LineBackgroundSpans.
@@ -656,6 +659,7 @@
* @return The range of lines that need to be drawn, possibly empty.
* @hide
*/
+ @UnsupportedAppUsage
public long getLineRangeForDraw(Canvas canvas) {
int dtop, dbottom;
@@ -926,6 +930,7 @@
* @return true if at a level boundary
* @hide
*/
+ @UnsupportedAppUsage
public boolean isLevelBoundary(int offset) {
int line = getLineForOffset(offset);
Directions dirs = getLineDirections(line);
@@ -1128,6 +1133,7 @@
* optionally clamp it so that it doesn't exceed the width of the layout.
* @hide
*/
+ @UnsupportedAppUsage
public float getPrimaryHorizontal(int offset, boolean clamped) {
boolean trailing = primaryIsTrailingPrevious(offset);
return getHorizontal(offset, trailing, clamped);
@@ -1147,6 +1153,7 @@
* optionally clamp it so that it doesn't exceed the width of the layout.
* @hide
*/
+ @UnsupportedAppUsage
public float getSecondaryHorizontal(int offset, boolean clamped) {
boolean trailing = primaryIsTrailingPrevious(offset);
return getHorizontal(offset, !trailing, clamped);
@@ -1771,6 +1778,7 @@
* only robust for left-aligned displays.
* @hide
*/
+ @UnsupportedAppUsage
public boolean shouldClampCursor(int line) {
// Only clamp cursor position in left-aligned displays.
switch (getParagraphAlignment(line)) {
@@ -2421,6 +2429,7 @@
}
private CharSequence mText;
+ @UnsupportedAppUsage
private TextPaint mPaint;
private TextPaint mWorkPaint = new TextPaint();
private int mWidth;
@@ -2446,6 +2455,7 @@
/* package */ static final int DIR_REQUEST_LTR = 1;
/* package */ static final int DIR_REQUEST_RTL = -1;
+ @UnsupportedAppUsage
/* package */ static final int DIR_REQUEST_DEFAULT_LTR = 2;
/* package */ static final int DIR_REQUEST_DEFAULT_RTL = -2;
@@ -2459,8 +2469,10 @@
ALIGN_OPPOSITE,
ALIGN_CENTER,
/** @hide */
+ @UnsupportedAppUsage
ALIGN_LEFT,
/** @hide */
+ @UnsupportedAppUsage
ALIGN_RIGHT,
}
@@ -2468,11 +2480,13 @@
/** @hide */
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
+ @UnsupportedAppUsage
public static final Directions DIRS_ALL_LEFT_TO_RIGHT =
new Directions(new int[] { 0, RUN_LENGTH_MASK });
/** @hide */
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
+ @UnsupportedAppUsage
public static final Directions DIRS_ALL_RIGHT_TO_LEFT =
new Directions(new int[] { 0, RUN_LENGTH_MASK | RUN_RTL_FLAG });
diff --git a/core/java/android/text/Selection.java b/core/java/android/text/Selection.java
index 5256e47..68199a4 100644
--- a/core/java/android/text/Selection.java
+++ b/core/java/android/text/Selection.java
@@ -17,6 +17,7 @@
package android.text;
import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
import java.text.BreakIterator;
@@ -448,6 +449,7 @@
}
/** {@hide} */
+ @UnsupportedAppUsage
public static boolean moveToPreceding(
Spannable text, PositionIterator iter, boolean extendSelection) {
final int offset = iter.preceding(getSelectionEnd(text));
@@ -462,6 +464,7 @@
}
/** {@hide} */
+ @UnsupportedAppUsage
public static boolean moveToFollowing(
Spannable text, PositionIterator iter, boolean extendSelection) {
final int offset = iter.following(getSelectionEnd(text));
diff --git a/core/java/android/text/SpanSet.java b/core/java/android/text/SpanSet.java
index 00f1493..362825a 100644
--- a/core/java/android/text/SpanSet.java
+++ b/core/java/android/text/SpanSet.java
@@ -16,6 +16,7 @@
package android.text;
+import android.annotation.UnsupportedAppUsage;
import java.lang.reflect.Array;
import java.util.Arrays;
@@ -32,6 +33,7 @@
private final Class<? extends E> classType;
int numberOfSpans;
+ @UnsupportedAppUsage
E[] spans;
int[] spanStarts;
int[] spanEnds;
diff --git a/core/java/android/text/SpannableStringBuilder.java b/core/java/android/text/SpannableStringBuilder.java
index 41a9c45..9d841e8 100644
--- a/core/java/android/text/SpannableStringBuilder.java
+++ b/core/java/android/text/SpannableStringBuilder.java
@@ -17,6 +17,7 @@
package android.text;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.BaseCanvas;
import android.graphics.Paint;
import android.util.Log;
@@ -595,6 +596,7 @@
return false;
}
+ @UnsupportedAppUsage
private void sendToSpanWatchers(int replaceStart, int replaceEnd, int nbNewChars) {
for (int i = 0; i < mSpanCount; i++) {
int spanFlags = mSpanFlags[i];
@@ -861,6 +863,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public <T> T[] getSpans(int queryStart, int queryEnd, @Nullable Class<T> kind,
boolean sortByInsertionOrder) {
if (kind == null) return (T[]) ArrayUtils.emptyArray(Object.class);
@@ -1230,6 +1233,7 @@
* [start, end[ range.
* @hide
*/
+ @UnsupportedAppUsage
public String substring(int start, int end) {
char[] buf = new char[end - start];
getChars(start, end, buf, 0);
@@ -1765,18 +1769,26 @@
private InputFilter[] mFilters = NO_FILTERS;
+ @UnsupportedAppUsage
private char[] mText;
+ @UnsupportedAppUsage
private int mGapStart;
+ @UnsupportedAppUsage
private int mGapLength;
+ @UnsupportedAppUsage
private Object[] mSpans;
+ @UnsupportedAppUsage
private int[] mSpanStarts;
+ @UnsupportedAppUsage
private int[] mSpanEnds;
private int[] mSpanMax; // see calcMax() for an explanation of what this array stores
+ @UnsupportedAppUsage
private int[] mSpanFlags;
private int[] mSpanOrder; // store the order of span insertion
private int mSpanInsertCount; // counter for the span insertion
+ @UnsupportedAppUsage
private int mSpanCount;
private IdentityHashMap<Object, Integer> mIndexOfSpan;
private int mLowWaterMark; // indices below this have not been touched
diff --git a/core/java/android/text/SpannableStringInternal.java b/core/java/android/text/SpannableStringInternal.java
index bcc2fda..7acd539 100644
--- a/core/java/android/text/SpannableStringInternal.java
+++ b/core/java/android/text/SpannableStringInternal.java
@@ -21,6 +21,7 @@
import libcore.util.EmptyArray;
+import android.annotation.UnsupportedAppUsage;
import java.lang.reflect.Array;
/* package */ abstract class SpannableStringInternal
@@ -50,6 +51,7 @@
*
* Due to backward compatibility reasons, we copy even NoCopySpan by default
*/
+ @UnsupportedAppUsage
/* package */ SpannableStringInternal(CharSequence source, int start, int end) {
this(source, start, end, false /* ignoreNoCopySpan */);
}
@@ -148,6 +150,7 @@
*
* @return True if excluded, false if included.
*/
+ @UnsupportedAppUsage
private final boolean isOutOfCopyRange(int start, int end, int spanStart, int spanEnd) {
if (spanStart > end || spanEnd < start) return true;
if (spanStart != spanEnd && start != end) {
@@ -174,14 +177,17 @@
mText.getChars(start, end, dest, off);
}
+ @UnsupportedAppUsage
/* package */ void setSpan(Object what, int start, int end, int flags) {
setSpan(what, start, end, flags, true/*enforceParagraph*/);
}
+ @UnsupportedAppUsage
private boolean isIndexFollowsNextLine(int index) {
return index != 0 && index != length() && charAt(index - 1) != '\n';
}
+ @UnsupportedAppUsage
private void setSpan(Object what, int start, int end, int flags, boolean enforceParagraph) {
int nstart = start;
int nend = end;
@@ -248,6 +254,7 @@
sendSpanAdded(what, nstart, nend);
}
+ @UnsupportedAppUsage
/* package */ void removeSpan(Object what) {
removeSpan(what, 0 /* flags */);
}
@@ -281,6 +288,7 @@
}
}
+ @UnsupportedAppUsage
public int getSpanStart(Object what) {
int count = mSpanCount;
Object[] spans = mSpans;
@@ -295,6 +303,7 @@
return -1;
}
+ @UnsupportedAppUsage
public int getSpanEnd(Object what) {
int count = mSpanCount;
Object[] spans = mSpans;
@@ -309,6 +318,7 @@
return -1;
}
+ @UnsupportedAppUsage
public int getSpanFlags(Object what) {
int count = mSpanCount;
Object[] spans = mSpans;
@@ -323,6 +333,7 @@
return 0;
}
+ @UnsupportedAppUsage
public <T> T[] getSpans(int queryStart, int queryEnd, Class<T> kind) {
int count = 0;
@@ -404,6 +415,7 @@
return (T[]) nret;
}
+ @UnsupportedAppUsage
public int nextSpanTransition(int start, int limit, Class kind) {
int count = mSpanCount;
Object[] spans = mSpans;
@@ -426,6 +438,7 @@
return limit;
}
+ @UnsupportedAppUsage
private void sendSpanAdded(Object what, int start, int end) {
SpanWatcher[] recip = getSpans(start, end, SpanWatcher.class);
int n = recip.length;
@@ -435,6 +448,7 @@
}
}
+ @UnsupportedAppUsage
private void sendSpanRemoved(Object what, int start, int end) {
SpanWatcher[] recip = getSpans(start, end, SpanWatcher.class);
int n = recip.length;
@@ -444,6 +458,7 @@
}
}
+ @UnsupportedAppUsage
private void sendSpanChanged(Object what, int s, int e, int st, int en) {
SpanWatcher[] recip = getSpans(Math.min(s, st), Math.max(e, en),
SpanWatcher.class);
@@ -454,10 +469,12 @@
}
}
+ @UnsupportedAppUsage
private static String region(int start, int end) {
return "(" + start + " ... " + end + ")";
}
+ @UnsupportedAppUsage
private void checkRange(final String operation, int start, int end) {
if (end < start) {
throw new IndexOutOfBoundsException(operation + " " +
@@ -534,25 +551,36 @@
*
* Due to backward compatibility reasons, we copy even NoCopySpan by default
*/
+ @UnsupportedAppUsage
private void copySpans(Spanned src, int start, int end) {
copySpans(src, start, end, false);
}
+ @UnsupportedAppUsage
private void copySpans(SpannableStringInternal src, int start, int end) {
copySpans(src, start, end, false);
}
+ @UnsupportedAppUsage
private String mText;
+ @UnsupportedAppUsage
private Object[] mSpans;
+ @UnsupportedAppUsage
private int[] mSpanData;
+ @UnsupportedAppUsage
private int mSpanCount;
+ @UnsupportedAppUsage
/* package */ static final Object[] EMPTY = new Object[0];
+ @UnsupportedAppUsage
private static final int START = 0;
+ @UnsupportedAppUsage
private static final int END = 1;
+ @UnsupportedAppUsage
private static final int FLAGS = 2;
+ @UnsupportedAppUsage
private static final int COLUMNS = 3;
}
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index 0899074..44edad2 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -20,6 +20,7 @@
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Paint;
import android.text.AutoGrowArray.FloatArray;
import android.text.style.LeadingMarginSpan;
@@ -500,6 +501,7 @@
* @deprecated Use {@link Builder} instead.
*/
@Deprecated
+ @UnsupportedAppUsage
public StaticLayout(CharSequence source, int bufstart, int bufend,
TextPaint paint, int outerwidth,
Alignment align, TextDirectionHeuristic textDir,
@@ -1324,6 +1326,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public int getHeight(boolean cap) {
if (cap && mLineCount >= mMaximumVisibleLineCount && mMaxLineHeight == -1 &&
Log.isLoggable(TAG, Log.WARN)) {
@@ -1379,8 +1382,10 @@
@NonNull int[] recycleFlags,
@NonNull float[] charWidths);
+ @UnsupportedAppUsage
private int mLineCount;
private int mTopPadding, mBottomPadding;
+ @UnsupportedAppUsage
private int mColumns;
private int mEllipsizedWidth;
@@ -1408,11 +1413,15 @@
private static final int DESCENT = 2;
private static final int EXTRA = 3;
private static final int HYPHEN = 4;
+ @UnsupportedAppUsage
private static final int ELLIPSIS_START = 5;
private static final int ELLIPSIS_COUNT = 6;
+ @UnsupportedAppUsage
private int[] mLines;
+ @UnsupportedAppUsage
private Directions[] mLineDirections;
+ @UnsupportedAppUsage
private int mMaximumVisibleLineCount = Integer.MAX_VALUE;
private static final int START_MASK = 0x1FFFFFFF;
@@ -1432,10 +1441,15 @@
// performing line breaking
/*package*/ static class LineBreaks {
private static final int INITIAL_SIZE = 16;
+ @UnsupportedAppUsage
public int[] breaks = new int[INITIAL_SIZE];
+ @UnsupportedAppUsage
public float[] widths = new float[INITIAL_SIZE];
+ @UnsupportedAppUsage
public float[] ascents = new float[INITIAL_SIZE];
+ @UnsupportedAppUsage
public float[] descents = new float[INITIAL_SIZE];
+ @UnsupportedAppUsage
public int[] flags = new int[INITIAL_SIZE]; // hasTab
// breaks, widths, and flags should all have the same length
}
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java
index 5bfd3e9..90d8d43 100644
--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.FontMetricsInt;
@@ -50,6 +51,7 @@
private static final boolean DEBUG = false;
private TextPaint mPaint;
+ @UnsupportedAppUsage
private CharSequence mText;
private int mStart;
private int mLen;
@@ -59,6 +61,7 @@
private TabStops mTabs;
private char[] mChars;
private boolean mCharsValid;
+ @UnsupportedAppUsage
private Spanned mSpanned;
private PrecomputedText mComputed;
@@ -68,16 +71,20 @@
private final TextPaint mWorkPaint = new TextPaint();
private final TextPaint mActivePaint = new TextPaint();
+ @UnsupportedAppUsage
private final SpanSet<MetricAffectingSpan> mMetricAffectingSpanSpanSet =
new SpanSet<MetricAffectingSpan>(MetricAffectingSpan.class);
+ @UnsupportedAppUsage
private final SpanSet<CharacterStyle> mCharacterStyleSpanSet =
new SpanSet<CharacterStyle>(CharacterStyle.class);
+ @UnsupportedAppUsage
private final SpanSet<ReplacementSpan> mReplacementSpanSpanSet =
new SpanSet<ReplacementSpan>(ReplacementSpan.class);
private final DecorationInfo mDecorationInfo = new DecorationInfo();
private final ArrayList<DecorationInfo> mDecorations = new ArrayList<>();
+ @UnsupportedAppUsage
private static final TextLine[] sCached = new TextLine[3];
/**
@@ -86,6 +93,7 @@
* @return an uninitialized TextLine
*/
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
+ @UnsupportedAppUsage
public static TextLine obtain() {
TextLine tl;
synchronized (sCached) {
diff --git a/core/java/android/text/TextPaint.java b/core/java/android/text/TextPaint.java
index 5234fa9..7bcc685 100644
--- a/core/java/android/text/TextPaint.java
+++ b/core/java/android/text/TextPaint.java
@@ -18,6 +18,7 @@
import android.annotation.ColorInt;
import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Paint;
/**
@@ -39,11 +40,13 @@
* @hide
*/
@ColorInt
+ @UnsupportedAppUsage
public int underlineColor = 0;
/**
* Thickness of the underline, in pixels.
* @hide
*/
+ @UnsupportedAppUsage
public float underlineThickness;
public TextPaint() {
@@ -98,6 +101,7 @@
* @param thickness underline thickness
* @hide
*/
+ @UnsupportedAppUsage
public void setUnderlineText(int color, float thickness) {
underlineColor = color;
underlineThickness = thickness;
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java
index 109149f..fda0a3e 100644
--- a/core/java/android/text/TextUtils.java
+++ b/core/java/android/text/TextUtils.java
@@ -21,6 +21,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.PluralsRes;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.res.Resources;
import android.icu.lang.UCharacter;
@@ -1193,6 +1194,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
END_SMALL
}
@@ -1732,6 +1734,7 @@
/**
* @hide
*/
+ @UnsupportedAppUsage
public static boolean isPrintableAsciiOnly(final CharSequence str) {
final int len = str.length();
for (int i = 0; i < len; i++) {
@@ -1957,6 +1960,7 @@
* @see #unpackRangeEndFromLong(long)
* @hide
*/
+ @UnsupportedAppUsage
public static long packRangeInLong(int start, int end) {
return (((long) start) << 32) | end;
}
@@ -1967,6 +1971,7 @@
* @see #packRangeInLong(int, int)
* @hide
*/
+ @UnsupportedAppUsage
public static int unpackRangeStartFromLong(long range) {
return (int) (range >>> 32);
}
@@ -1977,6 +1982,7 @@
* @see #packRangeInLong(int, int)
* @hide
*/
+ @UnsupportedAppUsage
public static int unpackRangeEndFromLong(long range) {
return (int) (range & 0x00000000FFFFFFFFL);
}
diff --git a/core/java/android/text/format/DateFormat.java b/core/java/android/text/format/DateFormat.java
index 94025ef..3c8de94 100755
--- a/core/java/android/text/format/DateFormat.java
+++ b/core/java/android/text/format/DateFormat.java
@@ -17,6 +17,7 @@
package android.text.format;
import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.UserHandle;
import android.provider.Settings;
@@ -178,6 +179,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public static boolean is24HourFormat(Context context, int userHandle) {
final String value = Settings.System.getStringForUser(context.getContentResolver(),
Settings.System.TIME_12_24, userHandle);
@@ -270,6 +272,7 @@
* @param context the application context
* @hide
*/
+ @UnsupportedAppUsage
public static String getTimeFormatString(Context context) {
return getTimeFormatString(context, context.getUserId());
}
@@ -281,6 +284,7 @@
* @param userHandle the user handle of the user to query the format for
* @hide
*/
+ @UnsupportedAppUsage
public static String getTimeFormatString(Context context, int userHandle) {
final LocaleData d = LocaleData.get(context.getResources().getConfiguration().locale);
return is24HourFormat(context, userHandle) ? d.timeFormat_Hm : d.timeFormat_hm;
@@ -379,6 +383,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public static boolean hasSeconds(CharSequence inFormat) {
return hasDesignator(inFormat, SECONDS);
}
@@ -392,6 +397,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public static boolean hasDesignator(CharSequence inFormat, char designator) {
if (inFormat == null) return false;
diff --git a/core/java/android/text/format/DateUtils.java b/core/java/android/text/format/DateUtils.java
index e19b2c7..e94b800 100644
--- a/core/java/android/text/format/DateUtils.java
+++ b/core/java/android/text/format/DateUtils.java
@@ -16,6 +16,7 @@
package android.text.format;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -361,6 +362,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public static CharSequence formatDuration(long millis) {
return formatDuration(millis, LENGTH_LONG);
}
@@ -376,6 +378,7 @@
* the briefest form available (e.g. "2h").
* @hide
*/
+ @UnsupportedAppUsage
public static CharSequence formatDuration(long millis, int abbrev) {
final FormatWidth width;
switch (abbrev) {
diff --git a/core/java/android/text/format/Formatter.java b/core/java/android/text/format/Formatter.java
index de86a66..077d12d 100644
--- a/core/java/android/text/format/Formatter.java
+++ b/core/java/android/text/format/Formatter.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.res.Resources;
import android.icu.text.MeasureFormat;
@@ -114,6 +115,7 @@
}
/** {@hide} */
+ @UnsupportedAppUsage
public static BytesResult formatBytes(Resources res, long sizeBytes, int flags) {
final int unit = ((flags & FLAG_IEC_UNITS) != 0) ? 1024 : 1000;
final boolean isNegative = (sizeBytes < 0);
@@ -216,6 +218,7 @@
* @return the formatted elapsed time
* @hide
*/
+ @UnsupportedAppUsage
public static String formatShortElapsedTime(Context context, long millis) {
long secondsLong = millis / 1000;
@@ -271,6 +274,7 @@
* @return the formatted elapsed time
* @hide
*/
+ @UnsupportedAppUsage
public static String formatShortElapsedTimeRoundingUpToMinutes(Context context, long millis) {
long minutesRoundedUp = (millis + MILLIS_PER_MINUTE - 1) / MILLIS_PER_MINUTE;
diff --git a/core/java/android/text/method/AllCapsTransformationMethod.java b/core/java/android/text/method/AllCapsTransformationMethod.java
index c807e7d..5a7c98d 100644
--- a/core/java/android/text/method/AllCapsTransformationMethod.java
+++ b/core/java/android/text/method/AllCapsTransformationMethod.java
@@ -17,6 +17,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.graphics.Rect;
import android.text.Spanned;
@@ -38,6 +39,7 @@
private boolean mEnabled;
private Locale mLocale;
+ @UnsupportedAppUsage
public AllCapsTransformationMethod(@NonNull Context context) {
mLocale = context.getResources().getConfiguration().getLocales().get(0);
}
diff --git a/core/java/android/text/method/HideReturnsTransformationMethod.java b/core/java/android/text/method/HideReturnsTransformationMethod.java
index c6a90ca..e753754 100644
--- a/core/java/android/text/method/HideReturnsTransformationMethod.java
+++ b/core/java/android/text/method/HideReturnsTransformationMethod.java
@@ -16,6 +16,8 @@
package android.text.method;
+import android.annotation.UnsupportedAppUsage;
+
/**
* This transformation method causes any carriage return characters (\r)
* to be hidden by displaying them as zero-width non-breaking space
@@ -48,5 +50,6 @@
return sInstance;
}
+ @UnsupportedAppUsage
private static HideReturnsTransformationMethod sInstance;
}
diff --git a/core/java/android/text/method/LinkMovementMethod.java b/core/java/android/text/method/LinkMovementMethod.java
index 549f8b3..a0c44a8 100644
--- a/core/java/android/text/method/LinkMovementMethod.java
+++ b/core/java/android/text/method/LinkMovementMethod.java
@@ -16,6 +16,7 @@
package android.text.method;
+import android.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.text.Layout;
import android.text.NoCopySpan;
@@ -274,6 +275,7 @@
return sInstance;
}
+ @UnsupportedAppUsage
private static LinkMovementMethod sInstance;
private static Object FROM_BELOW = new NoCopySpan.Concrete();
}
diff --git a/core/java/android/text/method/MetaKeyKeyListener.java b/core/java/android/text/method/MetaKeyKeyListener.java
index c3c7302..ec7ed34b 100644
--- a/core/java/android/text/method/MetaKeyKeyListener.java
+++ b/core/java/android/text/method/MetaKeyKeyListener.java
@@ -16,6 +16,7 @@
package android.text.method;
+import android.annotation.UnsupportedAppUsage;
import android.text.Editable;
import android.text.NoCopySpan;
import android.text.Spannable;
@@ -361,6 +362,7 @@
* Start selecting text.
* @hide pending API review
*/
+ @UnsupportedAppUsage
public static void startSelecting(View view, Spannable content) {
content.setSpan(SELECTING, 0, 0, PRESSED);
}
@@ -370,6 +372,7 @@
* call {@link android.text.Selection#setSelection} too.
* @hide pending API review
*/
+ @UnsupportedAppUsage
public static void stopSelecting(View view, Spannable content) {
content.removeSpan(SELECTING);
}
diff --git a/core/java/android/text/method/PasswordTransformationMethod.java b/core/java/android/text/method/PasswordTransformationMethod.java
index 4485e38..479fdf4 100644
--- a/core/java/android/text/method/PasswordTransformationMethod.java
+++ b/core/java/android/text/method/PasswordTransformationMethod.java
@@ -16,6 +16,7 @@
package android.text.method;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Rect;
import android.os.Handler;
import android.os.SystemClock;
@@ -261,6 +262,8 @@
}
}
+ @UnsupportedAppUsage
private static PasswordTransformationMethod sInstance;
+ @UnsupportedAppUsage
private static char DOT = '\u2022';
}
diff --git a/core/java/android/text/method/TransformationMethod2.java b/core/java/android/text/method/TransformationMethod2.java
index ef00ecd..0bf401a 100644
--- a/core/java/android/text/method/TransformationMethod2.java
+++ b/core/java/android/text/method/TransformationMethod2.java
@@ -15,6 +15,8 @@
*/
package android.text.method;
+import android.annotation.UnsupportedAppUsage;
+
/**
* TransformationMethod2 extends the TransformationMethod interface
* and adds the ability to relax restrictions of TransformationMethod.
@@ -29,5 +31,6 @@
* @param allowLengthChanges true to allow the transformation to change the length
* of the input string.
*/
+ @UnsupportedAppUsage
public void setLengthChangesAllowed(boolean allowLengthChanges);
}
diff --git a/core/java/android/text/method/WordIterator.java b/core/java/android/text/method/WordIterator.java
index 33e96a8..313567a 100644
--- a/core/java/android/text/method/WordIterator.java
+++ b/core/java/android/text/method/WordIterator.java
@@ -17,6 +17,7 @@
package android.text.method;
import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
import android.icu.lang.UCharacter;
import android.icu.lang.UProperty;
import android.icu.text.BreakIterator;
@@ -52,10 +53,12 @@
* Constructs a new WordIterator for the specified locale.
* @param locale The locale to be used for analyzing the text.
*/
+ @UnsupportedAppUsage
public WordIterator(Locale locale) {
mIterator = BreakIterator.getWordInstance(locale);
}
+ @UnsupportedAppUsage
public void setCharSequence(@NonNull CharSequence charSequence, int start, int end) {
if (0 <= start && end <= charSequence.length()) {
mCharSeq = charSequence;
@@ -68,6 +71,7 @@
}
/** {@inheritDoc} */
+ @UnsupportedAppUsage
public int preceding(int offset) {
checkOffsetIsValid(offset);
while (true) {
@@ -79,6 +83,7 @@
}
/** {@inheritDoc} */
+ @UnsupportedAppUsage
public int following(int offset) {
checkOffsetIsValid(offset);
while (true) {
@@ -90,6 +95,7 @@
}
/** {@inheritDoc} */
+ @UnsupportedAppUsage
public boolean isBoundary(int offset) {
checkOffsetIsValid(offset);
return mIterator.isBoundary(offset);
@@ -102,6 +108,7 @@
* @param offset the given start position to search from.
* @return the position of the last boundary preceding the given offset.
*/
+ @UnsupportedAppUsage
public int nextBoundary(int offset) {
checkOffsetIsValid(offset);
return mIterator.following(offset);
@@ -114,6 +121,7 @@
* @param offset the given start position to search from.
* @return the position of the last boundary preceding the given offset.
*/
+ @UnsupportedAppUsage
public int prevBoundary(int offset) {
checkOffsetIsValid(offset);
return mIterator.preceding(offset);
@@ -131,6 +139,7 @@
*
* @throws IllegalArgumentException is offset is not valid.
*/
+ @UnsupportedAppUsage
public int getBeginning(int offset) {
// TODO: Check if usage of this can be updated to getBeginning(offset, true) if
// so this method can be removed.
@@ -150,6 +159,7 @@
*
* @throws IllegalArgumentException is offset is not valid.
*/
+ @UnsupportedAppUsage
public int getEnd(int offset) {
// TODO: Check if usage of this can be updated to getEnd(offset, true), if
// so this method can be removed.
@@ -170,6 +180,7 @@
*
* @throws IllegalArgumentException is offset is not valid.
*/
+ @UnsupportedAppUsage
public int getPrevWordBeginningOnTwoWordsBoundary(int offset) {
return getBeginning(offset, true);
}
@@ -188,6 +199,7 @@
*
* @throws IllegalArgumentException is offset is not valid.
*/
+ @UnsupportedAppUsage
public int getNextWordEndOnTwoWordBoundary(int offset) {
return getEnd(offset, true);
}
@@ -268,6 +280,7 @@
*
* @param offset the offset to search from.
*/
+ @UnsupportedAppUsage
public int getPunctuationBeginning(int offset) {
checkOffsetIsValid(offset);
while (offset != BreakIterator.DONE && !isPunctuationStartBoundary(offset)) {
@@ -284,6 +297,7 @@
*
* @param offset the offset to search from.
*/
+ @UnsupportedAppUsage
public int getPunctuationEnd(int offset) {
checkOffsetIsValid(offset);
while (offset != BreakIterator.DONE && !isPunctuationEndBoundary(offset)) {
@@ -300,6 +314,7 @@
* @param offset the offset to check from.
* @return Whether the offset is after a punctuation character.
*/
+ @UnsupportedAppUsage
public boolean isAfterPunctuation(int offset) {
if (mStart < offset && offset <= mEnd) {
final int codePoint = Character.codePointBefore(mCharSeq, offset);
@@ -315,6 +330,7 @@
* @param offset the offset to check from.
* @return Whether the offset is at a punctuation character.
*/
+ @UnsupportedAppUsage
public boolean isOnPunctuation(int offset) {
if (mStart <= offset && offset < mEnd) {
final int codePoint = Character.codePointAt(mCharSeq, offset);
diff --git a/core/java/android/text/style/BulletSpan.java b/core/java/android/text/style/BulletSpan.java
index 70175c8..4013447 100644
--- a/core/java/android/text/style/BulletSpan.java
+++ b/core/java/android/text/style/BulletSpan.java
@@ -21,6 +21,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Px;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
@@ -70,12 +71,15 @@
private static final int STANDARD_COLOR = 0;
@Px
+ @UnsupportedAppUsage
private final int mGapWidth;
@Px
private final int mBulletRadius;
private Path mBulletPath = null;
@ColorInt
+ @UnsupportedAppUsage
private final int mColor;
+ @UnsupportedAppUsage
private final boolean mWantColor;
/**
diff --git a/core/java/android/text/style/DynamicDrawableSpan.java b/core/java/android/text/style/DynamicDrawableSpan.java
index 1b16f33..be772af 100644
--- a/core/java/android/text/style/DynamicDrawableSpan.java
+++ b/core/java/android/text/style/DynamicDrawableSpan.java
@@ -19,6 +19,7 @@
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
@@ -78,6 +79,7 @@
protected final int mVerticalAlignment;
+ @UnsupportedAppUsage
private WeakReference<Drawable> mDrawableRef;
/**
diff --git a/core/java/android/text/style/EasyEditSpan.java b/core/java/android/text/style/EasyEditSpan.java
index 9ee0b07..8f744f3 100644
--- a/core/java/android/text/style/EasyEditSpan.java
+++ b/core/java/android/text/style/EasyEditSpan.java
@@ -17,6 +17,7 @@
package android.text.style;
import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
import android.app.PendingIntent;
import android.os.Parcel;
import android.text.ParcelableSpan;
@@ -116,6 +117,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public boolean isDeleteEnabled() {
return mDeleteEnabled;
}
@@ -125,6 +127,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public void setDeleteEnabled(boolean value) {
mDeleteEnabled = value;
}
@@ -134,6 +137,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public PendingIntent getPendingIntent() {
return mPendingIntent;
}
diff --git a/core/java/android/text/style/ImageSpan.java b/core/java/android/text/style/ImageSpan.java
index 95f0b43..d4edde9 100644
--- a/core/java/android/text/style/ImageSpan.java
+++ b/core/java/android/text/style/ImageSpan.java
@@ -19,6 +19,7 @@
import android.annotation.DrawableRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -57,6 +58,7 @@
public class ImageSpan extends DynamicDrawableSpan {
@Nullable
+ @UnsupportedAppUsage
private Drawable mDrawable;
@Nullable
private Uri mContentUri;
diff --git a/core/java/android/text/style/SpellCheckSpan.java b/core/java/android/text/style/SpellCheckSpan.java
index 10275c2..6ffde38 100644
--- a/core/java/android/text/style/SpellCheckSpan.java
+++ b/core/java/android/text/style/SpellCheckSpan.java
@@ -16,6 +16,7 @@
package android.text.style;
+import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.text.ParcelableSpan;
import android.text.TextUtils;
@@ -31,18 +32,22 @@
private boolean mSpellCheckInProgress;
+ @UnsupportedAppUsage
public SpellCheckSpan() {
mSpellCheckInProgress = false;
}
+ @UnsupportedAppUsage
public SpellCheckSpan(Parcel src) {
mSpellCheckInProgress = (src.readInt() != 0);
}
+ @UnsupportedAppUsage
public void setSpellCheckInProgress(boolean inProgress) {
mSpellCheckInProgress = inProgress;
}
+ @UnsupportedAppUsage
public boolean isSpellCheckInProgress() {
return mSpellCheckInProgress;
}
diff --git a/core/java/android/text/style/SuggestionRangeSpan.java b/core/java/android/text/style/SuggestionRangeSpan.java
index c1943d5..d958dde 100644
--- a/core/java/android/text/style/SuggestionRangeSpan.java
+++ b/core/java/android/text/style/SuggestionRangeSpan.java
@@ -16,6 +16,7 @@
package android.text.style;
+import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.text.ParcelableSpan;
import android.text.TextPaint;
@@ -30,11 +31,13 @@
public class SuggestionRangeSpan extends CharacterStyle implements ParcelableSpan {
private int mBackgroundColor;
+ @UnsupportedAppUsage
public SuggestionRangeSpan() {
// 0 is a fully transparent black. Has to be set using #setBackgroundColor
mBackgroundColor = 0;
}
+ @UnsupportedAppUsage
public SuggestionRangeSpan(Parcel src) {
mBackgroundColor = src.readInt();
}
@@ -64,6 +67,7 @@
return TextUtils.SUGGESTION_RANGE_SPAN;
}
+ @UnsupportedAppUsage
public void setBackgroundColor(int backgroundColor) {
mBackgroundColor = backgroundColor;
}
diff --git a/core/java/android/text/style/SuggestionSpan.java b/core/java/android/text/style/SuggestionSpan.java
index 1b00db2..5210447 100644
--- a/core/java/android/text/style/SuggestionSpan.java
+++ b/core/java/android/text/style/SuggestionSpan.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
@@ -99,7 +100,9 @@
private final String mNotificationTargetPackageName;
private final int mHashCode;
+ @UnsupportedAppUsage
private float mEasyCorrectUnderlineThickness;
+ @UnsupportedAppUsage
private int mEasyCorrectUnderlineColor;
private float mMisspelledUnderlineThickness;
@@ -264,6 +267,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public String getNotificationTargetClassName() {
return mNotificationTargetClassName;
}
@@ -368,6 +372,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public int getUnderlineColor() {
// The order here should match what is used in updateDrawState
final boolean misspelled = (mFlags & FLAG_MISSPELLED) != 0;
@@ -390,6 +395,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public void notifySelection(Context context, String original, int index) {
final Intent intent = new Intent();
diff --git a/core/java/android/text/util/Linkify.java b/core/java/android/text/util/Linkify.java
index c905f49..9c8148d 100644
--- a/core/java/android/text/util/Linkify.java
+++ b/core/java/android/text/util/Linkify.java
@@ -20,6 +20,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UiThread;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.telephony.PhoneNumberUtils;
import android.telephony.TelephonyManager;
@@ -783,6 +784,7 @@
}
}
+ @UnsupportedAppUsage
private static void gatherTelLinks(ArrayList<LinkSpec> links, Spannable s,
@Nullable Context context) {
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();