diff options
author | 2024-07-19 16:50:10 +0000 | |
---|---|---|
committer | 2024-07-19 16:50:10 +0000 | |
commit | c0d50957ed772942141252f401d322961466e766 (patch) | |
tree | 8a5cab916b1ffba55dd1af34d7ab8914a0b6f501 /libs/binder/RpcSession.cpp | |
parent | 8578f13447d10824b9c29b0130f2096bb9401575 (diff) |
[RpcSession] Add checks before setting SessionSpecificRoot
for the IAccessor flow.
Bug: 338541373
Test: atest vm_accessor_test
Change-Id: I59a2847040857805a1e6c12027271deaf509fd09
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index 21dc5c1db1..49def82b5d 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -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; } |