Add org.apache.http.legacy to the APIs that are allowed to vendor apks
The package is no longer a part of Android API but has been supported
via 'uses-library'.
Bug: 113070388
Test: atest CtsUnofficialApisUsageTestCases
Merged-In: I4ce949f03cb9ddf3e5a54a19408c204dd33658c7
Change-Id: I4ce949f03cb9ddf3e5a54a19408c204dd33658c7
diff --git a/hostsidetests/api/Android.mk b/hostsidetests/api/Android.mk
index 11f1e9d..ec9a337 100644
--- a/hostsidetests/api/Android.mk
+++ b/hostsidetests/api/Android.mk
@@ -37,6 +37,9 @@
# API 27 is added since some support libraries are using old APIs
LOCAL_JAVA_RESOURCE_FILES += prebuilts/sdk/api/27.txt
+# org.apache.http.legacy is considered as approved APIs
+LOCAL_JAVA_RESOURCE_FILES += external/apache-http/api/apache-http-legacy-current.txt
+
include $(BUILD_HOST_JAVA_LIBRARY)
include $(CLEAR_VARS)
diff --git a/hostsidetests/api/src/com/android/cts/api/UnofficialApisUsageTest.java b/hostsidetests/api/src/com/android/cts/api/UnofficialApisUsageTest.java
index 6ecefb0f..ba36549 100644
--- a/hostsidetests/api/src/com/android/cts/api/UnofficialApisUsageTest.java
+++ b/hostsidetests/api/src/com/android/cts/api/UnofficialApisUsageTest.java
@@ -179,7 +179,8 @@
"/android-test-base-current.txt",
"/android-test-runner-current.txt",
"/android-test-mock-current.txt",
- "/27.txt"
+ "/27.txt",
+ "/apache-http-legacy-current"
}).map(name -> new File(name));
approvedApis = new ApprovedApis(apiFiles);