Also support setJniMethodFormat in hwui.

Idfb9e0900957e3a13bde10ba9626dd9b6ff4ac99 added support
for binding to a native methods that have been renamed by
a fixed pattern to jni_wrappers.h.

This commit copies the identical logic to graphics_jni_helpers.h
And also refactors the existing logic to avoid a memory leak.

Flag: EXEMPT: Only changes the behavior on host-side test.
Bug: 323057854
Test: m libandroid_runtime
Merged-In: I1a25389f7c6eb3270a32d858ee114ddadbc72a65
Change-Id: I232e1ca8ecf2faff2af692624a51188ed317e297
2 files changed