AImageDecoder: only support animation for F16 and 8888 (header)

Bug: 180594747
Test: I51dedd94aa8ff5d6846cada96861ffca30d509d7

In particular, a client might expect that ANDROID_BITMAP_FORMAT_RGB_565
is supported. (ANDROID_BITMAP_FORMAT_RGBA_4444 is not supported at all,
and ANDROID_BITMAP_FORMAT_NONE is an invalid request.
ANDROID_BITMAP_FORMAT_A_8 is only supported for PNG and JPEG, and
AImageDecoder does not support multiframe images in those formats
anyway.)

However, 565 requires that the image be opaque. Even if the first frame
is opaque, it is possible that a later frame is not. Moreover, the frame
data in a later frame may include transparent pixels, even if the
resulting frame is opaque after blending with the frame buffer. In that
case, libwebp and libgifcodec decode the frame data directly to 565, so
the fact that there were transparent pixels has been lost, and there is
no way to properly blend with the prior frame.

For clarity, specify the formats supported, rather than the ones not
supported.

Change-Id: I03818703dc79942be4e574db31c6e2927ab571ed
1 file changed