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

Commit c0d50957 authored by Alice Wang's avatar Alice Wang
Browse files

[RpcSession] Add checks before setting SessionSpecificRoot

for the IAccessor flow.

Bug: 338541373
Test: atest vm_accessor_test
Change-Id: I59a2847040857805a1e6c12027271deaf509fd09
parent 8578f134
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -802,6 +802,10 @@ bool RpcSession::setForServer(const wp<RpcServer>& server, const wp<EventListene
}

void RpcSession::setSessionSpecificRoot(const sp<IBinder>& sessionSpecificRoot) {
    LOG_ALWAYS_FATAL_IF(mSessionSpecificRootObject != nullptr,
                        "Session specific root object already set");
    LOG_ALWAYS_FATAL_IF(mForServer != nullptr,
                        "Session specific root object cannot be set for a server");
    mSessionSpecificRootObject = sessionSpecificRoot;
}