From 35f16e81dd0b2b4b2f91e79d1102d56063cd3743 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Wed, 25 Mar 2020 09:11:52 -0400 Subject: [PATCH] Address @hides in ImageDecoder Bug: 152322291 Test: make Once ImageDecoder is in a mainline module, the system can no longer access @hidden methods (unless they're @SystemApi), so this removes/documents some. The ones in Source are not used anywhere outside ImageDecoder AFAICT, so they are unneeded. Document setOutPaddingRect, which needs to be public/@hide so it can be accessed by the drawable package, which will also be in the module. Change-Id: I5cd9c0553e8d27d6679cbc431fcadc96d818687d --- graphics/java/android/graphics/ImageDecoder.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/graphics/java/android/graphics/ImageDecoder.java b/graphics/java/android/graphics/ImageDecoder.java index 83432c3626724..f2d1f291c2259 100644 --- a/graphics/java/android/graphics/ImageDecoder.java +++ b/graphics/java/android/graphics/ImageDecoder.java @@ -195,14 +195,11 @@ public final class ImageDecoder implements AutoCloseable { public static abstract class Source { private Source() {} - /* @hide */ @Nullable Resources getResources() { return null; } - /* @hide */ int getDensity() { return Bitmap.DENSITY_NONE; } - /* @hide */ final int computeDstDensity() { Resources res = getResources(); if (res == null) { @@ -212,7 +209,6 @@ public final class ImageDecoder implements AutoCloseable { return res.getDisplayMetrics().densityDpi; } - /* @hide */ @NonNull abstract ImageDecoder createImageDecoder(boolean preferAnimation) throws IOException; }; @@ -1413,6 +1409,8 @@ public final class ImageDecoder implements AutoCloseable { * {@link OnHeaderDecodedListener#onHeaderDecoded onHeaderDecoded}.

* * @hide + * Must be public for access from android.graphics.drawable, + * but must not be called from outside the UI module. */ public void setOutPaddingRect(@NonNull Rect outPadding) { mOutPaddingRect = outPadding;