Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 946a39f9 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Use String8/16 c_str [audio mainline modules]

Bug: 295394788
Test: make checkbuild
Change-Id: Ia22c10ef3ced8b677fb24047692248e7c3bf18dd
parent c640910e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ void ALooperRoster::dump(int fd, const Vector<String16>& args) {
        }
        s.append("\n");
    }
    (void)write(fd, s.string(), s.size());
    (void)write(fd, s.c_str(), s.size());
}

}  // namespace android
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ AString::AString(const String8 &from)
    : mData(NULL),
      mSize(0),
      mAllocSize(1) {
    setTo(from.string(), from.length());
    setTo(from.c_str(), from.length());
}

AString::AString(const AString &from)
+2 −2
Original line number Diff line number Diff line
@@ -434,7 +434,7 @@ String8 MetaDataBase::toString() const {
        char cc[5];
        MakeFourCCString(key, cc);
        const typed_data &item = mInternalData->mItems.valueAt(i);
        s.appendFormat("%s: %s", cc, item.asString(false).string());
        s.appendFormat("%s: %s", cc, item.asString(false).c_str());
        if (i != 0) {
            s.append(", ");
        }
@@ -448,7 +448,7 @@ void MetaDataBase::dumpToLog() const {
        char cc[5];
        MakeFourCCString(key, cc);
        const typed_data &item = mInternalData->mItems.valueAt(i);
        ALOGI("%s: %s", cc, item.asString(true /* verbose */).string());
        ALOGI("%s: %s", cc, item.asString(true /* verbose */).c_str());
    }
}

+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ void verifyDecode(const AString* expected, const AString* in) {
                paddedText.append(kBase64Padding);
            }
        }
        sp<ABuffer> result = decodeBase64(AString(paddedText.string()));
        sp<ABuffer> result = decodeBase64(AString(paddedText.c_str()));

        ASSERT_EQ(AStringUtils::Compare(expected[i].c_str(),
                reinterpret_cast<char*>(result->data()),
+5 −5
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ TEST_P(ID3textTagTest, TextTagTest) {
                String8 text;
                countTextFrames++;
                it.getString(&text);
                ALOGV("Found text frame %s : %s \n", id.string(), text.string());
                ALOGV("Found text frame %s : %s \n", id.c_str(), text.c_str());
            }
            it.next();
        }
@@ -106,10 +106,10 @@ TEST_P(ID3textTagTest, TextTagTest) {
            ASSERT_GT(id.length(), 0) << "Found an ID3 tag of 0 size";
            it.getString(&text);
            // if the tag has a value
            if (strcmp(text.string(), "")) {
            if (strcmp(text.c_str(), "")) {
                countTextFrames++;
                ALOGV("ID: %s\n", id.c_str());
                ALOGV("Text string: %s\n", text.string());
                ALOGV("Text string: %s\n", text.c_str());
            }
            it.next();
        }
@@ -134,7 +134,7 @@ TEST_P(ID3albumArtTest, AlbumArtTest) {

    if (albumArtPresent) {
        if (data) {
            ALOGV("Found album art: size = %zu mime = %s \n", dataSize, mime.string());
            ALOGV("Found album art: size = %zu mime = %s \n", dataSize, mime.c_str());
        }
        ASSERT_NE(data, nullptr) << "Expected album art, found none! " << path;
    } else {
@@ -168,7 +168,7 @@ TEST_P(ID3multiAlbumArtTest, MultiAlbumArtTest) {
            String8 mime;
            const void *data = tag.getAlbumArt(&dataSize, &mime);
            if (data) {
                ALOGV("Found album art: size = %zu mime = %s \n", dataSize, mime.string());
                ALOGV("Found album art: size = %zu mime = %s \n", dataSize, mime.c_str());
#if (LOG_NDEBUG == 0)
                hexdump(data, dataSize > 128 ? 128 : dataSize);
#endif
Loading