Add a fallback to bind-mount external libs elsewhere during Pre-reboot.

On Android V release (AP3A), we cannot bind-mount
/system{,_ext}/lib{,64} due to lack of an SELinux permission. As a
workaround, we bind-mount external libs at
/mnt/compat_env/system{,_ext}/lib{,64}, and patch the linker config to
make artd and art_exec link against external libs from there.

This change bumps the Pre-reboot version to 3, as the incompatibility
issue in Pre-reboot Dexopt is fully fixed after this change.

Note:
1. Only artd and art_exec needs to link against old external libs so
   far. artd depends on libbinder_ndk.so, and art_exec depends on
   libcgrouprc.so, where incompatibilities with the platform can occur.
   Forrunately, both of them have the "search" permission on
   /mnt/compat_env, where the bind-mounted old libs locate at.
2. When this fallback is used, other binaries such as dex2oat still
   link against new external libs because they don't have the "search"
   permission on /mnt/compat_env. Forrunately, they don't have to link
   against old libs.

Bug: 356858364
Test: atest art_standalone_dexopt_chroot_setup_tests
Test: -
  1. Flash AP3A.241005.002.
  2. Build an ART apex with this CL and install it.
  3. adb shell setprop ro.ota.allow_downgrade true
  4. OTA to AP4A.240729.001 (the bad OTA package that has
     https://r.android.com/3194614, which introduced an
     incompatibility with AP3A build, but does not have
     https://r.android.com/3196705, which disabled Pre-reboot Dexopt).
Change-Id: I9505b60d4cc47965bb08f06ed23c6c0b47906700
8 files changed