Adjust the dladdr-based introspection logic used in art::GetAndroidRootSafe.
This logic originally assumed that the libartbase library linked into
the current binary was always located in a directory within the
Android Root. This is no longer true on target since libartbase moved
to the Runtime APEX; therefore we now only use that logic on host in
art::GetAndroidRootSafe.
Eventually we should be able to use this logic on target to find the
Android Runtime Root (in art::GetAndroidRuntimeRootSafe), as
libartbase is installed in the Runtime APEX. However, this is not
always true at the moment, as ART gtests still install another copy of
libartbase in /system/lib(64) (the Android Root) on target.
Also improve the documentation of methods `art::GetAndroidRoot(Safe)`
and `art::GetAndroidRuntimeRoot(Safe)`.
Test: m test-art-host-gtest-file_utils_test
Bug: 121117762
Bug: 129534335
Change-Id: I835207110dae0a550c06ac98ed4915241cc61c6f
3 files changed