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

Commit b45eb830 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add implicit conversion operator to std::string_view" am: 17981e0a...

Merge "Add implicit conversion operator to std::string_view" am: 17981e0a am: 6ad1ca6c am: e5a837a4 am: 31cb5c00 am: 965b3041

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2164682



Change-Id: Ie7fee615c2231967545a0775dea6fa3ea5f7d289
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a7afb4a6 965b3041
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -985,7 +985,7 @@ MtpResponseCode MtpServer::doSendObjectInfo() {


    int type = storage->getType();
    int type = storage->getType();
    if (type == MTP_STORAGE_REMOVABLE_RAM) {
    if (type == MTP_STORAGE_REMOVABLE_RAM) {
        std::string str = android::base::Trim((const char*)name);
        std::string str = android::base::Trim(name);
        name.set(str.c_str());
        name.set(str.c_str());
    }
    }
    ALOGV("name: %s format: 0x%04X (%s)\n", (const char*)name, format,
    ALOGV("name: %s format: 0x%04X (%s)\n", (const char*)name, format,
+2 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@
#include <log/log.h>
#include <log/log.h>
#include <stdint.h>
#include <stdint.h>
#include <string>
#include <string>
#include <string_view>


// Max Character number of a MTP String
// Max Character number of a MTP String
#define MTP_STRING_MAX_CHARACTER_NUMBER             255
#define MTP_STRING_MAX_CHARACTER_NUMBER             255
@@ -55,6 +56,7 @@ public:
    inline int      size() const { return mString.length(); }
    inline int      size() const { return mString.length(); }


    inline operator const char*() const { return mString.c_str(); }
    inline operator const char*() const { return mString.c_str(); }
    operator std::string_view() const { return mString; }
};
};


inline void MtpStringBuffer::append(const char* other) {
inline void MtpStringBuffer::append(const char* other) {