From f00b5a580b8e4d9786aefc099dab522ec66f90d7 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Tue, 24 Mar 2020 15:25:35 -0400 Subject: [PATCH] Make ImageDecoder#getSampledSize private Bug: 152322291 Test: make I originally added this thinking a client might use the following pattern: Size size = decoder.getSampledSize(sampleSize); decoder.setTargetSize(size.getWidth(), size.getHeight()); But this is unnecessary. The client can directly call: decoder.setTargetSampleSize(sampleSize); OTOH, if the client wanted to use a crop, too, then it would be useful to know the exact sampled size. That could also be satisfied by adding accessors that return the target size. Change-Id: Id61907a8268f424d70503598d5bf844cde469d60 --- graphics/java/android/graphics/ImageDecoder.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/graphics/java/android/graphics/ImageDecoder.java b/graphics/java/android/graphics/ImageDecoder.java index 1f658bc97b34a..d14852ec43ea1 100644 --- a/graphics/java/android/graphics/ImageDecoder.java +++ b/graphics/java/android/graphics/ImageDecoder.java @@ -1072,11 +1072,9 @@ public final class ImageDecoder implements AutoCloseable { * @param sampleSize Sampling rate of the encoded image. * @return {@link android.util.Size} of the width and height after * sampling. - * - * @hide */ @NonNull - public Size getSampledSize(int sampleSize) { + private Size getSampledSize(int sampleSize) { if (sampleSize <= 0) { throw new IllegalArgumentException("sampleSize must be positive! " + "provided " + sampleSize);