Update CTS JNI tests for public libraries in APEXes.

Generalise the test to search for public libs in all APEXes that may
contribute them.

Handle libsigchain.so as an exception since it may (in a normal system
image) or may not (in native bridge) be loadable by apps due to the way
it's linked into app_process.

Also some code cleanups and more comments.

Test: `atest CtsJniTestCases` on cf_x86_64_phone and cf_x86_phone
Bug: 189959413
Change-Id: Ib309af2c8b4cd04b546d4a9222b2ecfce0111314
Merged-In: Ib309af2c8b4cd04b546d4a9222b2ecfce0111314
(cherry picked from commit 983f2f2ea80d3841381c2ff9bad850bf6fe4cce8)
2 files changed