ImageDecoder (BitmapFactory 2.0)

Bug: 63909536
Bug: 63908092

Test: CTS: I0f36ce34c968fd7fae4d8edebabea3a421859615

One-pager:
https://docs.google.com/document/d/1IWSdXb5O9lu-Zbj7SaNWo5pS7-FHlonFnqazjnecozM/
Design doc:
https://docs.google.com/document/d/15S6DSAV4EwOuJLv29UC_9cdSGdPg3KvOJVn2EHoP3fw/

ImageDecoder is designed to streamline certain patterns of BitmapFactory
use:
- choosing sample size based on actual dimensions
- choosing a specific output size
- post-processing (e.g. for rounded corners)
- copying to HARDWARE
- decode directly to ashmem
- creating a Drawable
- use as an alpha mask
- save RAM (e.g. use RGB_565)

In addition, it will include new features:
- animated drawables (TODO)
- report failures *and* optionally create a partial image
- crop

Add PostProcess to handle post-processing. It is separate from
ImageDecoder so that it may be used in the future by other commands that
might want something similar (e.g. capturing a View).

Consolidate NinePatch code for sharing between BitmapFactory and
ImageDecoder.

Some features left out of this CL:
- Create from ContentResolver + URI
- animation
- report more info in ImageInfo
- more overloads (e.g. null OnHeaderDecodedListener)

Change-Id: Icf011dc1b97b492788e47cf51fcf8abe8e9c7b88
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 8df0fb8..297bae2 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -123,6 +123,7 @@
         "android_graphics_Picture.cpp",
         "android/graphics/Bitmap.cpp",
         "android/graphics/BitmapFactory.cpp",
+        "android/graphics/ByteBufferStreamAdaptor.cpp",
         "android/graphics/Camera.cpp",
         "android/graphics/CanvasProperty.cpp",
         "android/graphics/ColorFilter.cpp",
@@ -134,6 +135,7 @@
         "android/graphics/GraphicBuffer.cpp",
         "android/graphics/Graphics.cpp",
         "android/graphics/HarfBuzzNGFaceSkia.cpp",
+        "android/graphics/ImageDecoder.cpp",
         "android/graphics/Interpolator.cpp",
         "android/graphics/MaskFilter.cpp",
         "android/graphics/Matrix.cpp",