Support conditional removal of oahl from bootclasspath
This makes the runtime handling of the org.apache.http.legacy library
conditional based on a build flag REMOVE_OAHL_FROM_BCP.
When REMOVE_OAHL_FROM_BCP=true:
* The framework-oahl-backward-compatibility is added to the
bootclasspath instead of org.apache.http.legacy.
* Any APK that targets pre-P has org.apache.http.legacy added to their
library list.
Otherwise:
* The org.apache.http.legacy library is added to the bootclasspath.
* Any APK that explicitly specifies that it depends on the
org.apache.http.legacy library has the library removed as the classes
are available at runtime.
Tested both cases by building with or without the build flag, flashing,
setting up, adding an account, adding a trusted place. Adding an account
failed when REMOVE_OAHL_FROM_BCP=true.
adb install -r -g out/target/product/marlin/testcases/FrameworksCoreTests/FrameworksCoreTests.apk
adb shell am instrument -w -e class android.content.pm.PackageBackwardCompatibilityTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 18027885
Bug: 72375096
Test: as above
Change-Id: Ie88fb79da76d3cbbd27eaf820c872191ecba2b17
6 files changed