summaryrefslogtreecommitdiff
path: root/android_icu4c
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2020-08-19 18:14:25 +0100
committerVictor Chang <vichang@google.com>2020-09-09 17:53:58 +0100
commit2b8ba1ebef64047a7e5aab62f6d799bc6a291d60 (patch)
tree39e9363ddc6049da37dbb7d07e32f52a20397fa4 /android_icu4c
parent36df475d30f8e966771e169accfd01f65b514912 (diff)
downloadicu-2b8ba1ebef64047a7e5aab62f6d799bc6a291d60.tar.gz
Generate NDK headers and a new public library libicu
Symbol selection - Expose the C symbols listed in libicu_export.txt - Currently, we focus on exposing the symbols used by the ART mainline module, and selecting a logical set of symbols from uchar.h, ustring.h, uloc.h, uversion.h and utypes.h. - The symbols are further filtered by checking whether we have provided the same functionality in Java by ICU4J/ICU4C via android.icu.*/java.* classes. The Java APIs are reviewed/proved useful and it could reduce the maintenance cost since ICU4J mostly mirrors the behavior of ICU4C and code changes/bug fixes are often applied in both places. But here is the exception: 1. uloc_setDefault Many places in libcore assumes Locale, ULocale, and ICU4C has the same default locale. App setting a different default locale in ICU4C will likely break things. 2. uloc_getDefault We could expose uloc_getDefault, but since uloc_setDefault is not exposed, uloc_getDefault becomes a shortcut function to obtain the default Locale from ULocale.getDefault or even framework's getResources().getConfiguration().locale. Such behavior is not well-documented in uloc_getDefault. Also, without ART managed runtime, e.g. standalone executable binary, the behavior could be undefined. Probably Android should provide JNI interop method/other C API to get the Android system default locale, but not via uloc_getDefault. - Other symbols excluded from the above headers u_UCharsToChars u_austrcpy u_austrncpy u_charsToUChars u_getFC_NFKC_Closure u_strCompareIter u_strFromJavaModifiedUTF8WithSub u_strFromWCS u_strToJavaModifiedUTF8 u_strToWCS u_uastrcpy u_uastrncpy u_unescape u_unescapeAt u_versionFromString u_versionFromUString uloc_acceptLanguageFromHTTP uloc_getLCID uloc_getLocaleForLCID uloc_getParent Symbol name - libicu.so will have symbols for the exact same functionality as the symbols in libicuuc.so and libicui18n.so, e.g. u_isalpha and u_isalpha_66. The ICU-version-specific symbol u_isalpha_66 is kept for app compatability because many app has been using it even though the version number increases for every platform release. u_isalpha is implemented as a shim of u_isalpha_66 in shim.cpp. Code transformation - shim.cpp, libicu.map.txt and the headers are generated by running the new generate_ndk.py script Test - CTS will be in the next CL. Bug: 160350521 Test: ./generate_ndk.py Test: m droid Change-Id: I2eb6d5a0968c72bb6922221a971414de20273041
Diffstat (limited to 'android_icu4c')
-rw-r--r--android_icu4c/Android.bp3
1 files changed, 3 insertions, 0 deletions
diff --git a/android_icu4c/Android.bp b/android_icu4c/Android.bp
index 98fd89faa..2bf2721f2 100644
--- a/android_icu4c/Android.bp
+++ b/android_icu4c/Android.bp
@@ -11,6 +11,9 @@
// 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.
+package {
+ default_visibility: ["//external/icu:__subpackages__"],
+}
// Android repo only headers for icu4c
// The header should mainly contain config for C preprocessor,