Skip to content

Commit 74befc9

Browse files
author
Steven Moreland
committed
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
1 parent 6acbf87 commit 74befc9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libs/binder/include/binder/Parcel.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ class Parcel {
178178
LIBBINDER_EXPORTED status_t writeUint64(uint64_t val);
179179
LIBBINDER_EXPORTED status_t writeFloat(float val);
180180
LIBBINDER_EXPORTED status_t writeDouble(double val);
181-
LIBBINDER_EXPORTED status_t writeCString(const char* str);
181+
LIBBINDER_EXPORTED status_t writeCString(const char* str)
182+
__attribute__((deprecated("use AIDL, writeString* instead")));
182183
LIBBINDER_EXPORTED status_t writeString8(const String8& str);
183184
LIBBINDER_EXPORTED status_t writeString8(const char* str, size_t len);
184185
LIBBINDER_EXPORTED status_t writeString16(const String16& str);
@@ -434,7 +435,8 @@ class Parcel {
434435
LIBBINDER_EXPORTED status_t readUtf8FromUtf16(std::unique_ptr<std::string>* str) const
435436
__attribute__((deprecated("use std::optional version instead")));
436437

437-
LIBBINDER_EXPORTED const char* readCString() const;
438+
LIBBINDER_EXPORTED const char* readCString() const
439+
__attribute__((deprecated("use AIDL, use readString*")));
438440
LIBBINDER_EXPORTED String8 readString8() const;
439441
LIBBINDER_EXPORTED status_t readString8(String8* pArg) const;
440442
LIBBINDER_EXPORTED const char* readString8Inplace(size_t* outLen) const;

0 commit comments

Comments
 (0)