Merge "Add python3 support for tools"
diff --git a/android_icu4c/include/uconfig_local.h b/android_icu4c/include/uconfig_local.h
index ec4a4a0..4b4e76d 100644
--- a/android_icu4c/include/uconfig_local.h
+++ b/android_icu4c/include/uconfig_local.h
@@ -20,13 +20,9 @@
  * stops the build process. Only the following libraries should have this
  * flag,
  * - Libraries in Runtime APEX module
- * - Host libraries
- * - Includes libicuuc as a static library
  * Otherwise, the libraries should use libandroidicu.
  */
 #if defined(__ANDROID__) && !defined(ANDROID_LINK_SHARED_ICU4C)
-// TODO: Enable #error when the exception flag ANDROID_LINK_SHARED_ICU4C is
-// added to all the android libraries
-// #error "Please use libandroidicu and do not directly link to libicuuc or libicui18n."
+#error "Please use libandroidicu and do not directly link to libicuuc or libicui18n."
 #endif
 
diff --git a/android_icu4j/testing/src/android/icu/extratest/AndroidICUVersionTest.java b/android_icu4j/testing/src/android/icu/extratest/AndroidICUVersionTest.java
index 094406e..edcaf88 100644
--- a/android_icu4j/testing/src/android/icu/extratest/AndroidICUVersionTest.java
+++ b/android_icu4j/testing/src/android/icu/extratest/AndroidICUVersionTest.java
@@ -25,6 +25,8 @@
 import android.icu.testsharding.MainTestShard;
 import android.icu.util.VersionInfo;
 
+import libcore.icu.ICU;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
@@ -51,11 +53,19 @@
 
     @Test
     public void testAndroidIcuVersion() {
-        VersionInfo actualVersion = VersionInfo.ICU_VERSION;
-        assertEquals("The ICU major version is not expected.",
-                expectedIcuVersion.getMajor(), actualVersion.getMajor());
-        assertTrue("Minor version can't be smaller than the expected.",
-                expectedIcuVersion.getMinor() <= actualVersion.getMinor());
+        // Check ICU4J.
+        VersionInfo actualIcu4jVersion = VersionInfo.ICU_VERSION;
+        assertEquals("The ICU4J major version is not expected.",
+                expectedIcuVersion.getMajor(), actualIcu4jVersion.getMajor());
+        assertTrue("ICU4J minor version can't be smaller than the expected.",
+                expectedIcuVersion.getMinor() <= actualIcu4jVersion.getMinor());
+
+        // Check ICU4C.
+        VersionInfo actualIcu4cVersion = VersionInfo.getInstance(ICU.getIcuVersion());
+        assertEquals("The ICU4C major version is not expected.",
+                expectedIcuVersion.getMajor(), actualIcu4cVersion.getMajor());
+        assertTrue("ICU4C minor version can't be smaller than the expected.",
+                expectedIcuVersion.getMinor() <= actualIcu4cVersion.getMinor());
     }
 
 }
diff --git a/android_utils/Android.bp b/android_utils/Android.bp
index 5b5bbc6..c2c4d7c 100644
--- a/android_utils/Android.bp
+++ b/android_utils/Android.bp
@@ -17,7 +17,7 @@
     host_supported: true,
     srcs: ["IcuUtils.cpp"],
     shared_libs: [
-        "libicuuc",
+        "libandroidicu",
         "liblog",
     ],
     cflags: [
diff --git a/icu4c/source/stubdata/CleanSpec.mk b/icu4c/source/stubdata/CleanSpec.mk
new file mode 100644
index 0000000..20c32b1
--- /dev/null
+++ b/icu4c/source/stubdata/CleanSpec.mk
@@ -0,0 +1,59 @@
+# Copyright (C) 2019 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list.  These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list.  E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# Clean out $(HOST_OUT)/com.android.runtime/etc/icu after
+# http://aosp/q/topic:%22move_system_icudat%22 was reverted.
+# In incremental builds the build system appears to remember how many clean
+# steps there have been and only executes those in slots it has never seen
+# before. So, we need to keep adding new entries steps. The reverted change
+# added a single clean spec entry of its own, now rolled back, which we
+# "mask" below with something innocuous (a dupe of the line after).
+$(call add-clean-step, rm -rf $(OUT_DIR)/host/linux-x86/com.android.runtime/etc/icu)
+$(call add-clean-step, rm -rf $(OUT_DIR)/host/linux-x86/com.android.runtime/etc/icu)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************