[HWUI] Remove private references to AHardwareBuffer

Bug: 135299581
Test: CtsGraphicsTestCases (BitmapTest)

Previously, we were calling
android_hardware_HardwareBuffer_getNativeHardwareBuffer, which is
private. There is already an NDK API for doing the same thing. Ideally,
we would use it directly. However, libandroid_graphics (where the
calling code resides) cannot depend on libandroid (where the NDK API
resides), because that would introduce a circular dependency. Instead,
use dlopen/dlsym to find the necessary method. A similar approach was
used in ag/9975329.

Change-Id: I660bbcd153c52c339245ce2b4ee7765c4efa4623
1 file changed