Loading libs/binder/Parcel.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -411,8 +411,9 @@ status_t Parcel::setData(const uint8_t* buffer, size_t len) status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len) { if (parcel->isForRpc() != isForRpc()) { ALOGE("Cannot append Parcel of one format to another."); if (mSession != parcel->mSession) { ALOGE("Cannot append Parcel from one context to another. They may be different formats, " "and objects are specific to a context."); return BAD_TYPE; } Loading libs/binder/tests/binderRpcTest.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -690,13 +690,21 @@ TEST_P(BinderRpc, TransactionsMustBeMarkedRpc) { } TEST_P(BinderRpc, AppendSeparateFormats) { auto proc = createRpcTestSocketServerProcess({}); auto proc1 = createRpcTestSocketServerProcess({}); auto proc2 = createRpcTestSocketServerProcess({}); Parcel pRaw; Parcel p1; p1.markForBinder(proc.rootBinder); p1.markForBinder(proc1.rootBinder); p1.writeInt32(3); EXPECT_EQ(BAD_TYPE, p1.appendFrom(&pRaw, 0, p1.dataSize())); EXPECT_EQ(BAD_TYPE, pRaw.appendFrom(&p1, 0, p1.dataSize())); Parcel p2; p2.markForBinder(proc2.rootBinder); p2.writeInt32(7); EXPECT_EQ(BAD_TYPE, p1.appendFrom(&p2, 0, p2.dataSize())); EXPECT_EQ(BAD_TYPE, p2.appendFrom(&p1, 0, p1.dataSize())); Loading Loading
libs/binder/Parcel.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -411,8 +411,9 @@ status_t Parcel::setData(const uint8_t* buffer, size_t len) status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len) { if (parcel->isForRpc() != isForRpc()) { ALOGE("Cannot append Parcel of one format to another."); if (mSession != parcel->mSession) { ALOGE("Cannot append Parcel from one context to another. They may be different formats, " "and objects are specific to a context."); return BAD_TYPE; } Loading
libs/binder/tests/binderRpcTest.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -690,13 +690,21 @@ TEST_P(BinderRpc, TransactionsMustBeMarkedRpc) { } TEST_P(BinderRpc, AppendSeparateFormats) { auto proc = createRpcTestSocketServerProcess({}); auto proc1 = createRpcTestSocketServerProcess({}); auto proc2 = createRpcTestSocketServerProcess({}); Parcel pRaw; Parcel p1; p1.markForBinder(proc.rootBinder); p1.markForBinder(proc1.rootBinder); p1.writeInt32(3); EXPECT_EQ(BAD_TYPE, p1.appendFrom(&pRaw, 0, p1.dataSize())); EXPECT_EQ(BAD_TYPE, pRaw.appendFrom(&p1, 0, p1.dataSize())); Parcel p2; p2.markForBinder(proc2.rootBinder); p2.writeInt32(7); EXPECT_EQ(BAD_TYPE, p1.appendFrom(&p2, 0, p2.dataSize())); EXPECT_EQ(BAD_TYPE, p2.appendFrom(&p1, 0, p1.dataSize())); Loading