summaryrefslogtreecommitdiffstats
path: root/core/jni/android_os_Parcel.cpp
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-11-20 22:25:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-20 22:25:07 +0000
commitd8c169fedf883491e46b354484909694fd52cfaf (patch)
treeacdec1eddce5fb5c55ab7ee791a54444456bde4d /core/jni/android_os_Parcel.cpp
parentbcb86374dccf15a8ee1dc03a1c69638fc6d9529f (diff)
parent0c437fd3a79ba5f9118ec10940a3398665690587 (diff)
downloadframeworks_base-d8c169fedf883491e46b354484909694fd52cfaf.zip
frameworks_base-d8c169fedf883491e46b354484909694fd52cfaf.tar.gz
frameworks_base-d8c169fedf883491e46b354484909694fd52cfaf.tar.bz2
am 0c437fd3: Merge "Add appropriate casts for char16_t."
* commit '0c437fd3a79ba5f9118ec10940a3398665690587': Add appropriate casts for char16_t.
Diffstat (limited to 'core/jni/android_os_Parcel.cpp')
-rw-r--r--core/jni/android_os_Parcel.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp
index 896faa6..16f7d12 100644
--- a/core/jni/android_os_Parcel.cpp
+++ b/core/jni/android_os_Parcel.cpp
@@ -277,7 +277,9 @@ static void android_os_Parcel_writeString(JNIEnv* env, jclass clazz, jlong nativ
if (val) {
const jchar* str = env->GetStringCritical(val, 0);
if (str) {
- err = parcel->writeString16(str, env->GetStringLength(val));
+ err = parcel->writeString16(
+ reinterpret_cast<const char16_t*>(str),
+ env->GetStringLength(val));
env->ReleaseStringCritical(val, str);
}
} else {
@@ -411,7 +413,7 @@ static jstring android_os_Parcel_readString(JNIEnv* env, jclass clazz, jlong nat
size_t len;
const char16_t* str = parcel->readString16Inplace(&len);
if (str) {
- return env->NewString(str, len);
+ return env->NewString(reinterpret_cast<const jchar*>(str), len);
}
return NULL;
}
@@ -453,7 +455,8 @@ static jobject android_os_Parcel_openFileDescriptor(JNIEnv* env, jclass clazz,
jniThrowException(env, "java/lang/IllegalStateException", NULL);
return NULL;
}
- String8 name8(str, env->GetStringLength(name));
+ String8 name8(reinterpret_cast<const char16_t*>(str),
+ env->GetStringLength(name));
env->ReleaseStringCritical(name, str);
int flags=0;
switch (mode&0x30000000) {
@@ -648,7 +651,9 @@ static void android_os_Parcel_writeInterfaceToken(JNIEnv* env, jclass clazz, jlo
// the caller expects to be invoking
const jchar* str = env->GetStringCritical(name, 0);
if (str != NULL) {
- parcel->writeInterfaceToken(String16(str, env->GetStringLength(name)));
+ parcel->writeInterfaceToken(String16(
+ reinterpret_cast<const char16_t*>(str),
+ env->GetStringLength(name)));
env->ReleaseStringCritical(name, str);
}
}
@@ -663,7 +668,8 @@ static void android_os_Parcel_enforceInterface(JNIEnv* env, jclass clazz, jlong
IPCThreadState* threadState = IPCThreadState::self();
const int32_t oldPolicy = threadState->getStrictModePolicy();
const bool isValid = parcel->enforceInterface(
- String16(str, env->GetStringLength(name)),
+ String16(reinterpret_cast<const char16_t*>(str),
+ env->GetStringLength(name)),
threadState);
env->ReleaseStringCritical(name, str);
if (isValid) {