Use String8/16 c_str [camera]
Bug: 295394788
Test: make checkbuild
Change-Id: I321053f5a82ca2e1ad9ea447f96e81a87c3fcfe0
diff --git a/camera/ndk/impl/ACameraDevice.cpp b/camera/ndk/impl/ACameraDevice.cpp
index eba9d94..b3de17d 100644
--- a/camera/ndk/impl/ACameraDevice.cpp
+++ b/camera/ndk/impl/ACameraDevice.cpp
@@ -163,7 +163,7 @@
templateId);
return ACAMERA_ERROR_INVALID_PARAMETER;
} else if (!remoteRet.isOk()) {
- ALOGE("Create capture request failed: %s", remoteRet.toString8().string());
+ ALOGE("Create capture request failed: %s", remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
ACaptureRequest* outReq = new ACaptureRequest();
@@ -317,22 +317,22 @@
switch (remoteRet.serviceSpecificErrorCode()) {
case hardware::ICameraService::ERROR_INVALID_OPERATION:
ALOGE("Camera device %s invalid operation: %s", getId(),
- remoteRet.toString8().string());
+ remoteRet.toString8().c_str());
return ACAMERA_ERROR_INVALID_OPERATION;
break;
case hardware::ICameraService::ERROR_ALREADY_EXISTS:
ALOGE("Camera device %s output surface already exists: %s", getId(),
- remoteRet.toString8().string());
+ remoteRet.toString8().c_str());
return ACAMERA_ERROR_INVALID_PARAMETER;
break;
case hardware::ICameraService::ERROR_ILLEGAL_ARGUMENT:
ALOGE("Camera device %s invalid input argument: %s", getId(),
- remoteRet.toString8().string());
+ remoteRet.toString8().c_str());
return ACAMERA_ERROR_INVALID_PARAMETER;
break;
default:
ALOGE("Camera device %s failed to add shared output: %s", getId(),
- remoteRet.toString8().string());
+ remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
}
@@ -494,7 +494,7 @@
ALOGV("Repeating request is already stopped.");
return ACAMERA_OK;
} else if (!remoteRet.isOk()) {
- ALOGE("Stop repeating request fails in remote: %s", remoteRet.toString8().string());
+ ALOGE("Stop repeating request fails in remote: %s", remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
checkRepeatingSequenceCompleteLocked(repeatingSequenceId, lastFrameNumber);
@@ -546,7 +546,7 @@
int64_t lastFrameNumber;
binder::Status remoteRet = mRemote->flush(&lastFrameNumber);
if (!remoteRet.isOk()) {
- ALOGE("Abort captures fails in remote: %s", remoteRet.toString8().string());
+ ALOGE("Abort captures fails in remote: %s", remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
if (mRepeatingSequenceId != REQUEST_ID_NONE) {
@@ -570,7 +570,7 @@
binder::Status remoteRet = mRemote->waitUntilIdle();
if (!remoteRet.isOk()) {
- ALOGE("Camera device %s waitUntilIdle failed: %s", getId(), remoteRet.toString8().string());
+ ALOGE("Camera device %s waitUntilIdle failed: %s", getId(), remoteRet.toString8().c_str());
// TODO: define a function to convert status_t -> camera_status_t
return ACAMERA_ERROR_UNKNOWN;
}
@@ -680,7 +680,7 @@
binder::Status remoteRet = mRemote->beginConfigure();
if (!remoteRet.isOk()) {
- ALOGE("Camera device %s begin configure failed: %s", getId(), remoteRet.toString8().string());
+ ALOGE("Camera device %s begin configure failed: %s", getId(), remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
@@ -689,7 +689,7 @@
remoteRet = mRemote->deleteStream(streamId);
if (!remoteRet.isOk()) {
ALOGE("Camera device %s failed to remove stream %d: %s", getId(), streamId,
- remoteRet.toString8().string());
+ remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
mConfiguredOutputs.erase(streamId);
@@ -701,7 +701,7 @@
remoteRet = mRemote->createStream(outputPair.second, &streamId);
if (!remoteRet.isOk()) {
ALOGE("Camera device %s failed to create stream: %s", getId(),
- remoteRet.toString8().string());
+ remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
mConfiguredOutputs.insert(std::make_pair(streamId, outputPair));
@@ -716,10 +716,10 @@
ns2ms(startTimeNs), &offlineStreamIds);
if (remoteRet.serviceSpecificErrorCode() == hardware::ICameraService::ERROR_ILLEGAL_ARGUMENT) {
ALOGE("Camera device %s cannnot support app output configuration: %s", getId(),
- remoteRet.toString8().string());
+ remoteRet.toString8().c_str());
return ACAMERA_ERROR_STREAM_CONFIGURE_FAIL;
} else if (!remoteRet.isOk()) {
- ALOGE("Camera device %s end configure failed: %s", getId(), remoteRet.toString8().string());
+ ALOGE("Camera device %s end configure failed: %s", getId(), remoteRet.toString8().c_str());
return ACAMERA_ERROR_UNKNOWN;
}
@@ -866,7 +866,7 @@
if (cbh.mIsLogicalCameraCallback) {
if (resultExtras.errorPhysicalCameraId.size() > 0) {
String8 cameraId = toString8(resultExtras.errorPhysicalCameraId);
- msg->setString(kFailingPhysicalCameraId, cameraId.string(), cameraId.size());
+ msg->setString(kFailingPhysicalCameraId, cameraId.c_str(), cameraId.size());
}
msg->setPointer(kCallbackFpKey, (void*) cbh.mOnLogicalCameraCaptureFailed);
} else {