From 93945f2c6909289313ac7477b3eda0e71b0efac7 Mon Sep 17 00:00:00 2001 From: Scott Randolph Date: Mon, 3 Apr 2017 14:06:05 -0700 Subject: [PATCH] Use explicit .c_str() for hidl_string hidl_string no longer will provide an implicit cast to const char* as it interfers with other expected behaviors of the class. It now emulated std::string in requiring a call to .c_str() to get the same behavior. Bug: 36532780 Test: Build the tree Change-Id: I86f4b7ef9e20674299519bd421d833b5d858ac6a --- .../jni/com_android_server_location_ContextHubService.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/core/jni/com_android_server_location_ContextHubService.cpp b/services/core/jni/com_android_server_location_ContextHubService.cpp index c976fe55a922a..d834e2527e080 100644 --- a/services/core/jni/com_android_server_location_ContextHubService.cpp +++ b/services/core/jni/com_android_server_location_ContextHubService.cpp @@ -929,15 +929,15 @@ jobject constructJContextHubInfo(JNIEnv *env, const ContextHub &hub) { db.jniInfo.contextHubInfoCtor); env->CallVoidMethod(jHub, db.jniInfo.contextHubInfoSetId, hub.hubId); - jstrBuf = env->NewStringUTF(hub.name); + jstrBuf = env->NewStringUTF(hub.name.c_str()); env->CallVoidMethod(jHub, db.jniInfo.contextHubInfoSetName, jstrBuf); env->DeleteLocalRef(jstrBuf); - jstrBuf = env->NewStringUTF(hub.vendor); + jstrBuf = env->NewStringUTF(hub.vendor.c_str()); env->CallVoidMethod(jHub, db.jniInfo.contextHubInfoSetVendor, jstrBuf); env->DeleteLocalRef(jstrBuf); - jstrBuf = env->NewStringUTF(hub.toolchain); + jstrBuf = env->NewStringUTF(hub.toolchain.c_str()); env->CallVoidMethod(jHub, db.jniInfo.contextHubInfoSetToolchain, jstrBuf); env->DeleteLocalRef(jstrBuf);