Loading graphics/java/android/graphics/BitmapFactory.java +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.graphics; import android.content.res.AssetManager; import android.content.res.Resources; import android.os.MemoryFile; import android.util.DisplayMetrics; import android.util.TypedValue; Loading Loading @@ -435,6 +436,17 @@ public class BitmapFactory { * @return the decoded bitmap, or null */ public static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, Options opts) { try { if (MemoryFile.isMemoryFile(fd)) { int mappedlength = MemoryFile.getMappedSize(fd); MemoryFile file = new MemoryFile(fd, mappedlength, "r"); InputStream is = file.getInputStream(); return decodeStream(is, outPadding, opts); } } catch (IOException ex) { // invalid filedescriptor, no need to call nativeDecodeFileDescriptor() return null; } return nativeDecodeFileDescriptor(fd, outPadding, opts); } Loading @@ -447,7 +459,7 @@ public class BitmapFactory { * @return the decoded bitmap, or null */ public static Bitmap decodeFileDescriptor(FileDescriptor fd) { return nativeDecodeFileDescriptor(fd, null, null); return decodeFileDescriptor(fd, null, null); } private static native Bitmap nativeDecodeStream(InputStream is, byte[] storage, Loading Loading
graphics/java/android/graphics/BitmapFactory.java +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.graphics; import android.content.res.AssetManager; import android.content.res.Resources; import android.os.MemoryFile; import android.util.DisplayMetrics; import android.util.TypedValue; Loading Loading @@ -435,6 +436,17 @@ public class BitmapFactory { * @return the decoded bitmap, or null */ public static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, Options opts) { try { if (MemoryFile.isMemoryFile(fd)) { int mappedlength = MemoryFile.getMappedSize(fd); MemoryFile file = new MemoryFile(fd, mappedlength, "r"); InputStream is = file.getInputStream(); return decodeStream(is, outPadding, opts); } } catch (IOException ex) { // invalid filedescriptor, no need to call nativeDecodeFileDescriptor() return null; } return nativeDecodeFileDescriptor(fd, outPadding, opts); } Loading @@ -447,7 +459,7 @@ public class BitmapFactory { * @return the decoded bitmap, or null */ public static Bitmap decodeFileDescriptor(FileDescriptor fd) { return nativeDecodeFileDescriptor(fd, null, null); return decodeFileDescriptor(fd, null, null); } private static native Bitmap nativeDecodeStream(InputStream is, byte[] storage, Loading