Skip to content

Commit 1da7821

Browse files
Treehugger Robotandroid-build-merge-worker-robot
authored andcommitted
Merge "libbinder: usage warnings for some older features" into main am: cad194d am: eea4706
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3436786 Change-Id: I76e73e753e7b919be5e4b5e81065ef33e9464016 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2 parents 5d7cd39 + eea4706 commit 1da7821

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

libs/binder/include/binder/Parcel.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,11 @@ class Parcel {
388388
LIBBINDER_EXPORTED status_t
389389
writeUniqueFileDescriptorVector(const std::vector<binder::unique_fd>& val);
390390

391+
// WARNING: deprecated and incompatible with AIDL. You should use Parcelable
392+
// definitions outside of Parcel to represent shared memory, such as
393+
// IMemory or with ParcelFileDescriptor. We should remove this, or move it to be
394+
// external to Parcel, it's not a very encapsulated API.
395+
//
391396
// Writes a blob to the parcel.
392397
// If the blob is small, then it is stored in-place, otherwise it is
393398
// transferred by way of an anonymous shared memory region. Prefer sending
@@ -630,6 +635,11 @@ class Parcel {
630635
LIBBINDER_EXPORTED status_t
631636
readUniqueFileDescriptorVector(std::vector<binder::unique_fd>* val) const;
632637

638+
// WARNING: deprecated and incompatible with AIDL. You should use Parcelable
639+
// definitions outside of Parcel to represent shared memory, such as
640+
// IMemory or with ParcelFileDescriptor. We should remove this, or move it to be
641+
// external to Parcel, it's not a very encapsulated API.
642+
//
633643
// Reads a blob from the parcel.
634644
// The caller should call release() on the blob after reading its contents.
635645
LIBBINDER_EXPORTED status_t readBlob(size_t len, ReadableBlob* outBlob) const;

libs/binder/include/binder/SafeInterface.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
namespace android {
3535
namespace SafeInterface {
3636

37+
/**
38+
* WARNING: Prefer to use AIDL-generated interfaces. Using SafeInterface to generate interfaces
39+
* does not support tracing, and many other AIDL features out of the box. The general direction
40+
* we should go is to migrate safe interface users to AIDL and then remove this so that there
41+
* is only one thing to learn/use/test/integrate, not this as well.
42+
*/
43+
3744
// ParcelHandler is responsible for writing/reading various types to/from a Parcel in a generic way
3845
class LIBBINDER_EXPORTED ParcelHandler {
3946
public:

0 commit comments

Comments
 (0)