Merge "hidl: Update for IFoo::descriptor -> const char *." am: e17e68f139 am: 5f9ac42029 am: cd0f045eb7
am: d3a15478a7
Change-Id: If7a15e25ad9c9110c12a114a181a6c4a6bc21b6d
diff --git a/core/jni/android_os_HwParcel.cpp b/core/jni/android_os_HwParcel.cpp
index 886c0e6..f909580 100644
--- a/core/jni/android_os_HwParcel.cpp
+++ b/core/jni/android_os_HwParcel.cpp
@@ -267,9 +267,9 @@
const jchar *interfaceName = env->GetStringCritical(interfaceNameObj, NULL);
if (interfaceName) {
- String16 nameCopy(
+ String8 nameCopy = String8(String16(
reinterpret_cast<const char16_t *>(interfaceName),
- env->GetStringLength(interfaceNameObj));
+ env->GetStringLength(interfaceNameObj)));
env->ReleaseStringCritical(interfaceNameObj, interfaceName);
interfaceName = NULL;
@@ -277,7 +277,7 @@
hardware::Parcel *parcel =
JHwParcel::GetNativeContext(env, thiz)->getParcel();
- status_t err = parcel->writeInterfaceToken(nameCopy);
+ status_t err = parcel->writeInterfaceToken(nameCopy.string());
signalExceptionForError(env, err);
}
}
@@ -294,9 +294,9 @@
const jchar *interfaceName = env->GetStringCritical(interfaceNameObj, NULL);
if (interfaceName) {
- String16 interfaceNameCopy(
+ String8 interfaceNameCopy = String8(String16(
reinterpret_cast<const char16_t *>(interfaceName),
- env->GetStringLength(interfaceNameObj));
+ env->GetStringLength(interfaceNameObj)));
env->ReleaseStringCritical(interfaceNameObj, interfaceName);
interfaceName = NULL;
@@ -304,7 +304,7 @@
hardware::Parcel *parcel =
JHwParcel::GetNativeContext(env, thiz)->getParcel();
- bool valid = parcel->enforceInterface(interfaceNameCopy);
+ bool valid = parcel->enforceInterface(interfaceNameCopy.string());
if (!valid) {
jniThrowException(