diff options
| author | 2019-07-15 17:41:39 -0700 | |
|---|---|---|
| committer | 2019-07-15 17:41:39 -0700 | |
| commit | 5a6852b87f2fcb9f78a78bc16e26528337fe98c4 (patch) | |
| tree | 7aa1fc6478b1649ec92c049f49cf82c9beb4d021 | |
| parent | d85cb03061c33f33c5d0708f6acf75652bbc2c3d (diff) | |
| parent | 6526cb999c4ff9e727da9c1a57250680669bd9b3 (diff) | |
Merge "libbinder: empty ping transaction" am: 67591ab43b
am: 6526cb999c
Change-Id: I961e5a88ef197a20fad5b933021dfb955053a079
| -rw-r--r-- | libs/binder/Binder.cpp | 2 | ||||
| -rw-r--r-- | libs/binder/BpBinder.cpp | 5 | ||||
| -rw-r--r-- | libs/binder/tests/binderDriverInterfaceTest.cpp | 8 |
3 files changed, 3 insertions, 12 deletions
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp index 3de4487b60..c1d916c62b 100644 --- a/libs/binder/Binder.cpp +++ b/libs/binder/Binder.cpp @@ -144,7 +144,7 @@ status_t BBinder::transact( status_t err = NO_ERROR; switch (code) { case PING_TRANSACTION: - reply->writeInt32(pingBinder()); + err = pingBinder(); break; default: err = onTransact(code, data, reply, flags); diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp index 67f968aea0..f35803c01d 100644 --- a/libs/binder/BpBinder.cpp +++ b/libs/binder/BpBinder.cpp @@ -186,10 +186,7 @@ status_t BpBinder::pingBinder() { Parcel send; Parcel reply; - status_t err = transact(PING_TRANSACTION, send, &reply); - if (err != NO_ERROR) return err; - if (reply.dataSize() < sizeof(status_t)) return NOT_ENOUGH_DATA; - return (status_t)reply.readInt32(); + return transact(PING_TRANSACTION, send, &reply); } status_t BpBinder::dump(int fd, const Vector<String16>& args) diff --git a/libs/binder/tests/binderDriverInterfaceTest.cpp b/libs/binder/tests/binderDriverInterfaceTest.cpp index 6508bb1283..77ebac8f5a 100644 --- a/libs/binder/tests/binderDriverInterfaceTest.cpp +++ b/libs/binder/tests/binderDriverInterfaceTest.cpp @@ -286,13 +286,7 @@ TEST_F(BinderDriverInterfaceTest, Transaction) { EXPECT_EQ(0u, br.arg2.cookie); EXPECT_EQ(0u, br.arg2.code); EXPECT_EQ(0u, br.arg2.flags); - - // ping returns a 4 byte header in libbinder, but the original - // C implementation of servicemanager returns a 0 byte header - if (br.arg2.data_size != 0 && br.arg2.data_size != 4) { - ADD_FAILURE() << br.arg2.data_size << " is expected to be 0 or 4"; - } - + EXPECT_EQ(0u, br.arg2.data_size); EXPECT_EQ(0u, br.arg2.offsets_size); SCOPED_TRACE("3rd WriteRead"); |