From 74befc9eaef3521ea575776e1ed2c75d49fb8b8e Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Wed, 20 Nov 2024 22:58:37 +0000 Subject: libbinder: deprecated notice for *CString These APIs are super custom and not used by AIDL. Don't manually write parceling code, and don't use CString with binder for sure either. Bug: 376674798 Test: N/A Change-Id: I8520c24f3a23f0e65e17c08e4e719dd410037c06 --- libs/binder/include/binder/Parcel.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/binder/include/binder/Parcel.h b/libs/binder/include/binder/Parcel.h index ceab20a275..0c7366e683 100644 --- a/libs/binder/include/binder/Parcel.h +++ b/libs/binder/include/binder/Parcel.h @@ -178,7 +178,8 @@ public: LIBBINDER_EXPORTED status_t writeUint64(uint64_t val); LIBBINDER_EXPORTED status_t writeFloat(float val); LIBBINDER_EXPORTED status_t writeDouble(double val); - LIBBINDER_EXPORTED status_t writeCString(const char* str); + LIBBINDER_EXPORTED status_t writeCString(const char* str) + __attribute__((deprecated("use AIDL, writeString* instead"))); LIBBINDER_EXPORTED status_t writeString8(const String8& str); LIBBINDER_EXPORTED status_t writeString8(const char* str, size_t len); LIBBINDER_EXPORTED status_t writeString16(const String16& str); @@ -434,7 +435,8 @@ public: LIBBINDER_EXPORTED status_t readUtf8FromUtf16(std::unique_ptr* str) const __attribute__((deprecated("use std::optional version instead"))); - LIBBINDER_EXPORTED const char* readCString() const; + LIBBINDER_EXPORTED const char* readCString() const + __attribute__((deprecated("use AIDL, use readString*"))); LIBBINDER_EXPORTED String8 readString8() const; LIBBINDER_EXPORTED status_t readString8(String8* pArg) const; LIBBINDER_EXPORTED const char* readString8Inplace(size_t* outLen) const; -- cgit v1.2.3-59-g8ed1b