Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adf11aef authored by Fredrik Roubert's avatar Fredrik Roubert
Browse files

Update JNI code in preparation for ICU 59 switching to C++11 char16_t.

ICU 59 (update pending on the aosp/icu59 branch) has switched to using
the C++11 char16_t data type, which is a distinct type from uint16_t
(which is what JNI's jchar is typedef'd as), even though they are
bitwise identical.

All code that passes UTF-16 data between ICU4C and JNI must therefore be
updated with typecasts in the appropriate places before ICU 59 is merged
to aosp/master.

Bug: 37554848
Test: make
Change-Id: Ibbc90d2b603382d4715551d05c4a6a462529542d
Merged-In: Ic84a94be82acbef41f80cc113d5da485ce54ae29
parent 29926838
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -38,7 +38,7 @@ static jint runBidi(JNIEnv* env, jobject obj, jint dir, jcharArray chsArray,
        if (info != NULL) {
        if (info != NULL) {
            UErrorCode status = U_ZERO_ERROR;
            UErrorCode status = U_ZERO_ERROR;
            UBiDi* bidi = ubidi_openSized(n, 0, &status);
            UBiDi* bidi = ubidi_openSized(n, 0, &status);
            ubidi_setPara(bidi, chs, n, dir, NULL, &status);
            ubidi_setPara(bidi, reinterpret_cast<const UChar*>(chs), n, dir, NULL, &status);
            if (U_SUCCESS(status)) {
            if (U_SUCCESS(status)) {
                for (int i = 0; i < n; ++i) {
                for (int i = 0; i < n; ++i) {
                  info[i] = ubidi_getLevelAt(bidi, i);
                  info[i] = ubidi_getLevelAt(bidi, i);