Add @UnsupportedAppUsage annotations
For packages: android.graphics android.graphics.drawable android.graphics.drawable.shapes android.graphics.fonts android.graphics.pdf 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 Merged-In: I7fc1162d2c63df8751a4660607e8ce72070efed8 Change-Id: I5d7739d2d1fc7bb12ee059bcc2a9ac9017ca35fb
This commit is contained in:
@@ -21,6 +21,7 @@ import android.annotation.ColorInt;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.Size;
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.content.res.ResourcesImpl;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -52,6 +53,7 @@ public final class Bitmap implements Parcelable {
|
||||
private static final long NATIVE_ALLOCATION_SIZE = 32;
|
||||
|
||||
// Convenience for JNI access
|
||||
@UnsupportedAppUsage
|
||||
private final long mNativePtr;
|
||||
|
||||
private final boolean mIsMutable;
|
||||
@@ -70,9 +72,13 @@ public final class Bitmap implements Parcelable {
|
||||
*/
|
||||
private boolean mRequestPremultiplied;
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private byte[] mNinePatchChunk; // may be null
|
||||
@UnsupportedAppUsage
|
||||
private NinePatch.InsetStruct mNinePatchInsets; // may be null
|
||||
@UnsupportedAppUsage
|
||||
private int mWidth;
|
||||
@UnsupportedAppUsage
|
||||
private int mHeight;
|
||||
private boolean mRecycled;
|
||||
|
||||
@@ -94,11 +100,13 @@ public final class Bitmap implements Parcelable {
|
||||
* density when running old apps.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public static void setDefaultDensity(int density) {
|
||||
sDefaultDensity = density;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@UnsupportedAppUsage
|
||||
static int getDefaultDensity() {
|
||||
if (sDefaultDensity >= 0) {
|
||||
return sDefaultDensity;
|
||||
@@ -155,6 +163,7 @@ public final class Bitmap implements Parcelable {
|
||||
* width/height values
|
||||
*/
|
||||
@SuppressWarnings("unused") // called from JNI
|
||||
@UnsupportedAppUsage
|
||||
void reinit(int width, int height, boolean requestPremultiplied) {
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
@@ -325,6 +334,7 @@ public final class Bitmap implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public void setNinePatchChunk(byte[] chunk) {
|
||||
mNinePatchChunk = chunk;
|
||||
}
|
||||
@@ -510,6 +520,7 @@ public final class Bitmap implements Parcelable {
|
||||
*/
|
||||
HARDWARE (7);
|
||||
|
||||
@UnsupportedAppUsage
|
||||
final int nativeInt;
|
||||
|
||||
private static Config sConfigs[] = {
|
||||
@@ -520,6 +531,7 @@ public final class Bitmap implements Parcelable {
|
||||
this.nativeInt = ni;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
static Config nativeToConfig(int ni) {
|
||||
return sConfigs[ni];
|
||||
}
|
||||
@@ -654,6 +666,7 @@ public final class Bitmap implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public Bitmap createAshmemBitmap() {
|
||||
checkRecycled("Can't copy a recycled bitmap");
|
||||
noteHardwareBitmapSlowCall();
|
||||
@@ -672,6 +685,7 @@ public final class Bitmap implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public Bitmap createAshmemBitmap(Config config) {
|
||||
checkRecycled("Can't copy a recycled bitmap");
|
||||
noteHardwareBitmapSlowCall();
|
||||
@@ -690,6 +704,7 @@ public final class Bitmap implements Parcelable {
|
||||
* currently PIXEL_FORMAT_RGBA_8888 is the only supported format
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public static Bitmap createHardwareBitmap(@NonNull GraphicBuffer graphicBuffer) {
|
||||
return nativeCreateHardwareBitmap(graphicBuffer);
|
||||
}
|
||||
@@ -1390,6 +1405,7 @@ public final class Bitmap implements Parcelable {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
static public int scaleFromDensity(int size, int sdensity, int tdensity) {
|
||||
if (sdensity == DENSITY_NONE || tdensity == DENSITY_NONE || sdensity == tdensity) {
|
||||
return size;
|
||||
@@ -1920,6 +1936,7 @@ public final class Bitmap implements Parcelable {
|
||||
* @return {@link GraphicBuffer} which is internally used by hardware bitmap
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public GraphicBuffer createGraphicBufferHandle() {
|
||||
return nativeCreateGraphicBufferHandle(mNativePtr);
|
||||
}
|
||||
@@ -1937,6 +1954,7 @@ public final class Bitmap implements Parcelable {
|
||||
private static native Bitmap nativeCopyAshmemConfig(long nativeSrcBitmap, int nativeConfig);
|
||||
private static native long nativeGetNativeFinalizer();
|
||||
private static native boolean nativeRecycle(long nativeBitmap);
|
||||
@UnsupportedAppUsage
|
||||
private static native void nativeReconfigure(long nativeBitmap, int width, int height,
|
||||
int config, boolean isPremultiplied);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user