Don't use ICU when built for vendors

libicuuc.so isn't available for vendors, thus ICU is turned off when
libxml2 is built for vendors.

Bug: 64104535
Test: BOARD_VNDK_VERSION=current m -j libxml2 libxml2.vendor
Test: BOARD_VNDK_VERSION=current m -j checkbuild
Merged-In: I91f3a59c97d27f2c2d3704489db18cc64922ba31
Change-Id: I91f3a59c97d27f2c2d3704489db18cc64922ba31
(cherry picked from commit d8ecd12ad7e975dd8912ccd93efb67e7e2034551)
diff --git a/Android.bp b/Android.bp
index 01fc87b..3d39506 100644
--- a/Android.bp
+++ b/Android.bp
@@ -34,6 +34,9 @@
 cc_library {
     name: "libxml2",
     vendor_available: true,
+    vndk: {
+        enabled: true,
+    },
     host_supported: true,
     srcs: [
         "SAX.c",
@@ -94,6 +97,9 @@
         host: {
             host_ldlibs: ["-ldl"],
         },
+        vendor: {
+            exclude_shared_libs: ["libicuuc"],
+        },
     },
     shared_libs: ["libicuuc"],
     export_shared_lib_headers: ["libicuuc"],
diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h
index c8163c6..eb18ea0 100644
--- a/include/libxml/xmlversion.h
+++ b/include/libxml/xmlversion.h
@@ -286,9 +286,14 @@
  * LIBXML_ICU_ENABLED:
  *
  * Whether icu support is available
+ *
+ * This is disabled when libxml2 is built for the VNDK.
+ * libicuuc.so isn't available in the VNDK.
  */
-#if 1
+#ifndef __ANDROID_VNDK__
 #define LIBXML_ICU_ENABLED
+#else
+#undef LIBXML_ICU_ENABLED
 #endif
 
 /**