Fix android.os.strictmode.LeakedClosableViolation
Test: Check log. Change-Id: I488fc6c4288bc3843a2be35a8e2988738441263e Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -682,8 +682,11 @@ public class ImageUtils {
|
||||
if (mScaled == null) {
|
||||
if (mDecoded == null) {
|
||||
mOptions.inSampleSize = mSampleSize;
|
||||
final InputStream inputStream = cr.openInputStream(mUri);
|
||||
mDecoded = BitmapFactory.decodeStream(inputStream, null, mOptions);
|
||||
try (final InputStream inputStream = cr.openInputStream(mUri)) {
|
||||
mDecoded = BitmapFactory.decodeStream(inputStream, null, mOptions);
|
||||
} catch (IOException e) {
|
||||
// Ignore
|
||||
}
|
||||
if (mDecoded == null) {
|
||||
if (logv) {
|
||||
LogUtil.v(LogUtil.BUGLE_IMAGE_TAG,
|
||||
|
||||
Reference in New Issue
Block a user