Compile libjavacore and libopenjdk against libandroidicu

Note:
1. Replace ICU registration  with a new C wrapper
2. char16ptr.h is not a new dependency, but included indirectly
previously.

Bug: 138994281
Test: m droid
Change-Id: I9b55f7f8ce6d10ad8fe227d65f0f53e420fbe9fd
diff --git a/NativeCode.bp b/NativeCode.bp
index 2041a92..c489d1a 100644
--- a/NativeCode.bp
+++ b/NativeCode.bp
@@ -67,22 +67,23 @@
         "libbase",
         "libcrypto",
         "libexpat",
-        "libicuuc",
-        "libicui18n",
         "libnativehelper",
         "libz",
     ],
     static_libs: [
-        "libandroidicuinit",
         "libziparchive",
     ],
     target: {
         android: {
-            cflags: [
-                // -DANDROID_LINK_SHARED_ICU4C to enable access to the full ICU4C.
-                // See external/icu/android_icu4c/include/uconfig_local.h
-                // for more information.
-                "-DANDROID_LINK_SHARED_ICU4C",
+            shared_libs: ["libandroidicu"],
+        },
+        host: {
+            shared_libs: [
+                "libicuuc",
+                "libicui18n",
+            ],
+            static_libs: [
+                "libandroidicuinit",
             ],
         },
     },
@@ -142,7 +143,6 @@
     shared_libs: [
         "libandroidio",
         "libcrypto",
-        "libicuuc",
         "libnativehelper",
         "libz",
     ],
@@ -158,16 +158,16 @@
             ],
         },
         android: {
-            cflags: [
-                // -DANDROID_LINK_SHARED_ICU4C to enable access to the full ICU4C.
-                // See external/icu/android_icu4c/include/uconfig_local.h
-                // for more information.
-                "-DANDROID_LINK_SHARED_ICU4C",
-            ],
             shared_libs: [
+                "libandroidicu",
                 "libdl_android",
             ],
         },
+        host: {
+            shared_libs: [
+                "libicuuc",
+            ],
+        },
     },
 
     notice: "ojluni/NOTICE",