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

Commit d02a1ba2 authored by Devin Moore's avatar Devin Moore Committed by Android (Google) Code Review
Browse files

Merge "Fatal if RpcServer root object is set after it's running" into main

parents 58c9fb11 76241ced
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -161,12 +161,14 @@ void RpcServer::setSupportedFileDescriptorTransportModes(

void RpcServer::setRootObject(const sp<IBinder>& binder) {
    RpcMutexLockGuard _l(mLock);
    LOG_ALWAYS_FATAL_IF(mJoinThreadRunning, "Cannot set root object while running");
    mRootObjectFactory = nullptr;
    mRootObjectWeak = mRootObject = binder;
}

void RpcServer::setRootObjectWeak(const wp<IBinder>& binder) {
    RpcMutexLockGuard _l(mLock);
    LOG_ALWAYS_FATAL_IF(mJoinThreadRunning, "Cannot set root object while running");
    mRootObject.clear();
    mRootObjectFactory = nullptr;
    mRootObjectWeak = binder;