ANativeWindow_toSurface implementation

This enables the conversion from an ANativeWindow (created by NDK API
such as: AImageReader_create) to a Java Surface, so that developers can
hookup a Java Producer to a native buffer consumer.

This CL also introduces android_view_Surface_createFromSurface helper
function in libandroid_runtime to convert a C++ sp<Surface> to a Java
Surface object.

Bug: 36862948
Test: android.media.cts.NativeImageReaderTest
Change-Id: Ia99adb654da505ac117a8e58153ac800df23a650
4 files changed