diff options
author | John Reck <jreck@google.com> | 2013-09-10 16:25:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-10 16:25:14 +0000 |
commit | 1d2daa7809b58c226410c0060d7837de0a29888a (patch) | |
tree | 4000e44aec08a20f016f35f169b0c38d2e08ff0f /graphics | |
parent | 8716c08151378f7488a0f129fe43a0b3d4dc499d (diff) | |
parent | 5835157d762a5b6bffe3d892c588ebc475bccb44 (diff) | |
download | frameworks_base-1d2daa7809b58c226410c0060d7837de0a29888a.zip frameworks_base-1d2daa7809b58c226410c0060d7837de0a29888a.tar.gz frameworks_base-1d2daa7809b58c226410c0060d7837de0a29888a.tar.bz2 |
Merge "Remove FD optimization case for decodeStream" into klp-dev
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/BitmapFactory.java | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java index e3adc59..23606a1 100644 --- a/graphics/java/android/graphics/BitmapFactory.java +++ b/graphics/java/android/graphics/BitmapFactory.java @@ -565,24 +565,10 @@ public class BitmapFactory { Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "decodeBitmap"); try { - boolean decodeGenericStream = true; if (is instanceof AssetManager.AssetInputStream) { final int asset = ((AssetManager.AssetInputStream) is).getAssetInt(); bm = nativeDecodeAsset(asset, outPadding, opts); - // Do not follow the normal case. - decodeGenericStream = false; - } else if (is instanceof FileInputStream) { - try { - FileDescriptor fd = ((FileInputStream) is).getFD(); - // decodeFileDescriptor will take care of throwing the IAE and - // calling setDensityFromOptions. - return decodeFileDescriptor(fd, outPadding, opts); - } catch (IOException e) { - // Fall through to nativeDecodeStream. - } - } - - if (decodeGenericStream) { + } else { byte [] tempStorage = null; if (opts != null) tempStorage = opts.inTempStorage; if (tempStorage == null) tempStorage = new byte[DECODE_BUFFER_SIZE]; |