summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2017-12-11 13:47:23 -0500
committerLeon Scroggins III <scroggo@google.com>2018-01-08 12:41:39 -0500
commited074fd70011cf804a14b5cf53ffd4b529c5f367 (patch)
tree86ee72779eb0ed8f5742d2dac992476c53e011c0 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent5c72a77bcaed8f399974f4edbf3d156a0ceb7cbb (diff)
Support using ImageDecoder with ContentResolver + URI
Bug: 63909536 Test: CTS: I0f36ce34c968fd7fae4d8edebabea3a421859615 Add ImageDecoder.createSource(ContentResolver, URI), allowing a client to decode images from files, content, resources, etc. Prefer using a file descriptor to using an InputStream so the input can be cheaply seeked and rewound if necessary. Make ImageDecoder implement AutoCloseable to handle closing the input. Make decodeDrawable/decodeBitmap always return an object or throw an IOException. Avoid checking for a file in the Source constructor. Fix a bug where inner Exception classes were not static. Update JavaInputStreamAdaptor to be usable by ImageDecoder: - previously it always swallowed exceptions. Allow them to propagate (optionally) so that they can be reported back to the client. - Add refs to the InputStream and byte[]. ImageDecoder returns from native and then uses the JavaInputStreamAdaptor again, making the local refs go out of scope. - Hold on to the JavaVM and convert to the JNIEnv when necessary. Pass local env pointers to avoid looking it up multiple times in one call. - If an exception is thrown inside the doRead() loop, return the number of bytes successfully read. Change-Id: I869dad55521cf942efd010c06baf3f44c1c08374
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions