Fix bug in JNI BitmapFactory

In nativeCreateLargeBitmapFromFileDescriptor() if the file descriptor
can not be rewinded isShareable should be set to false.

Change-Id: I7dd545c9d52d21c226e11b8921e35a1d9bba9515
This commit is contained in:
Joseph Wen
2010-09-10 10:15:09 +08:00
parent 6aec225010
commit 2dcfbefbbe
2 changed files with 63 additions and 41 deletions

View File

@@ -628,12 +628,6 @@ public class BitmapFactory {
*/
public static LargeBitmap createLargeBitmap(
FileDescriptor fd, boolean isShareable) throws IOException {
if (MemoryFile.isMemoryFile(fd)) {
int mappedlength = MemoryFile.getSize(fd);
MemoryFile file = new MemoryFile(fd, mappedlength, "r");
InputStream is = file.getInputStream();
return createLargeBitmap(is, isShareable);
}
return nativeCreateLargeBitmap(fd, isShareable);
}