Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 690d9203 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "freeze rpc binder wire protocol" into udc-dev am: 9111edc2

parents 70381d6e 9111edc2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -928,7 +928,7 @@ processTransactInternalTailCall:
                                          transactionData.size() -
                                                  offsetof(RpcWireTransaction, data)};
        Span<const uint32_t> objectTableSpan;
        if (session->getProtocolVersion().value() >
        if (session->getProtocolVersion().value() >=
            RPC_WIRE_PROTOCOL_VERSION_RPC_HEADER_FEATURE_EXPLICIT_PARCEL_SIZE) {
            std::optional<Span<const uint8_t>> objectTableBytes =
                    parcelSpan.splitOff(transaction->parcelDataSize);
+2 −2
Original line number Diff line number Diff line
@@ -37,9 +37,9 @@ class RpcState;
class RpcTransport;
class FdTrigger;

constexpr uint32_t RPC_WIRE_PROTOCOL_VERSION_NEXT = 1;
constexpr uint32_t RPC_WIRE_PROTOCOL_VERSION_NEXT = 2;
constexpr uint32_t RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL = 0xF0000000;
constexpr uint32_t RPC_WIRE_PROTOCOL_VERSION = RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL;
constexpr uint32_t RPC_WIRE_PROTOCOL_VERSION = 1;

// Starting with this version:
//
+12 −1
Original line number Diff line number Diff line
@@ -237,14 +237,25 @@ TEST(RpcWire, V0) {
    checkRepr(kCurrentRepr, 0);
}

TEST(RpcWire, V1) {
    checkRepr(kCurrentRepr, 1);
}

TEST(RpcWire, CurrentVersion) {
    checkRepr(kCurrentRepr, RPC_WIRE_PROTOCOL_VERSION);
}

static_assert(RPC_WIRE_PROTOCOL_VERSION == RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL,
static_assert(RPC_WIRE_PROTOCOL_VERSION == 1,
              "If the binder wire protocol is updated, this test should test additional versions. "
              "The binder wire protocol should only be updated on upstream AOSP.");

TEST(RpcWire, NextIsPlusOneReminder) {
    if (RPC_WIRE_PROTOCOL_VERSION != RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL) {
        EXPECT_EQ(RPC_WIRE_PROTOCOL_VERSION + 1, RPC_WIRE_PROTOCOL_VERSION_NEXT)
                << "Make sure to note what the next version should be.";
    }
}

TEST(RpcWire, ReleaseBranchHasFrozenRpcWireProtocol) {
    if (RPC_WIRE_PROTOCOL_VERSION == RPC_WIRE_PROTOCOL_VERSION_EXPERIMENTAL) {
        EXPECT_FALSE(base::GetProperty("ro.build.version.codename", "") == "REL")