From 2c3e53e5ddc7ba4b128106d6f196f58ebb1e3a9f Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 11 Aug 2023 18:11:12 +0000 Subject: [PATCH] Use String8/16 c_str Bug: 295394788 Test: make checkbuild Change-Id: If5cf93ade13d6e650ae305db9933a9f536e3b525 --- audio/AudioHardwareInterface.cpp | 2 +- audio/audio_hw_hal.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/AudioHardwareInterface.cpp b/audio/AudioHardwareInterface.cpp index dbf6f33..47fd74e 100644 --- a/audio/AudioHardwareInterface.cpp +++ b/audio/AudioHardwareInterface.cpp @@ -143,7 +143,7 @@ status_t AudioHardwareBase::dumpState(int fd, const Vector& args) result.append(buffer); snprintf(buffer, SIZE, "\tmMode: %d\n", mMode); result.append(buffer); - ::write(fd, result.string(), result.size()); + ::write(fd, result.c_str(), result.size()); dump(fd, args); // Dump the state of the concrete child. return NO_ERROR; } diff --git a/audio/audio_hw_hal.cpp b/audio/audio_hw_hal.cpp index 6ea05fd..ba27285 100644 --- a/audio/audio_hw_hal.cpp +++ b/audio/audio_hw_hal.cpp @@ -216,7 +216,7 @@ static char * out_get_parameters(const struct audio_stream *stream, const char * s8 = parms.toString(); } - return strdup(s8.string()); + return strdup(s8.c_str()); } static uint32_t out_get_latency(const struct audio_stream_out *stream) @@ -367,7 +367,7 @@ static char * in_get_parameters(const struct audio_stream *stream, s8 = parms.toString(); } - return strdup(s8.string()); + return strdup(s8.c_str()); } static int in_set_gain(struct audio_stream_in *stream, float gain) @@ -474,7 +474,7 @@ static char * adev_get_parameters(const struct audio_hw_device *dev, String8 s8; s8 = ladev->hwif->getParameters(String8(keys)); - return strdup(s8.string()); + return strdup(s8.c_str()); } static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,