diff --git a/api/current.txt b/api/current.txt index f6a0d02aaea90..298c27c7cd7e5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -14190,8 +14190,8 @@ package android.graphics { method @NonNull public static android.graphics.BitmapRegionDecoder newInstance(@NonNull byte[], int, int) throws java.io.IOException; method @Deprecated @NonNull public static android.graphics.BitmapRegionDecoder newInstance(@NonNull java.io.FileDescriptor, boolean) throws java.io.IOException; method @NonNull public static android.graphics.BitmapRegionDecoder newInstance(@NonNull android.os.ParcelFileDescriptor) throws java.io.IOException; - method @Deprecated @NonNull public static android.graphics.BitmapRegionDecoder newInstance(@NonNull java.io.InputStream, boolean) throws java.io.IOException; - method @NonNull public static android.graphics.BitmapRegionDecoder newInstance(@NonNull java.io.InputStream) throws java.io.IOException; + method @Deprecated @Nullable public static android.graphics.BitmapRegionDecoder newInstance(@NonNull java.io.InputStream, boolean) throws java.io.IOException; + method @Nullable public static android.graphics.BitmapRegionDecoder newInstance(@NonNull java.io.InputStream) throws java.io.IOException; method @Deprecated @NonNull public static android.graphics.BitmapRegionDecoder newInstance(@NonNull String, boolean) throws java.io.IOException; method @NonNull public static android.graphics.BitmapRegionDecoder newInstance(@NonNull String) throws java.io.IOException; method public void recycle(); diff --git a/graphics/java/android/graphics/BitmapRegionDecoder.java b/graphics/java/android/graphics/BitmapRegionDecoder.java index 4e1c5b0efea29..29112af9516b4 100644 --- a/graphics/java/android/graphics/BitmapRegionDecoder.java +++ b/graphics/java/android/graphics/BitmapRegionDecoder.java @@ -16,6 +16,7 @@ package android.graphics; import android.annotation.NonNull; +import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.content.res.AssetManager; import android.os.Build; @@ -125,6 +126,7 @@ public final class BitmapRegionDecoder { * @param is The input stream that holds the raw data to be decoded into a * BitmapRegionDecoder. * @param isShareable This field has always been ignored. + * @return A new BitmapRegionDecoder, or {@code null} if {@code is} is {@code null}. * @throws IOException if the image format is not supported or can not be decoded. * @deprecated In favor of {@link #newInstance(InputStream)} * @@ -134,7 +136,7 @@ public final class BitmapRegionDecoder { * {@link Build.VERSION_CODES#KITKAT}, this is no longer the case.

*/ @Deprecated - @NonNull + @Nullable public static BitmapRegionDecoder newInstance(@NonNull InputStream is, boolean isShareable) throws IOException { return newInstance(is); @@ -148,9 +150,10 @@ public final class BitmapRegionDecoder { * * @param is The input stream that holds the raw data to be decoded into a * BitmapRegionDecoder. + * @return A new BitmapRegionDecoder, or {@code null} if {@code is} is {@code null}. * @throws IOException if the image format is not supported or can not be decoded. */ - @NonNull + @Nullable public static BitmapRegionDecoder newInstance(@NonNull InputStream is) throws IOException { if (is instanceof AssetManager.AssetInputStream) { return nativeNewInstance(