diff options
| -rw-r--r-- | cmds/servicemanager/main.cpp | 5 | ||||
| -rw-r--r-- | libs/binder/include/binder/ProcessState.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/cmds/servicemanager/main.cpp b/cmds/servicemanager/main.cpp index c1a04dde89..520d6f9e7e 100644 --- a/cmds/servicemanager/main.cpp +++ b/cmds/servicemanager/main.cpp @@ -131,7 +131,10 @@ int main(int argc, char** argv) { } IPCThreadState::self()->setTheContextObject(manager); - ps->becomeContextManager(); + if (!ps->becomeContextManager()) { + LOG(ERROR) << "Could not become context manager"; + // TODO(b/280514080): fatal + } sp<Looper> looper = Looper::prepare(false /*allowNonCallbacks*/); diff --git a/libs/binder/include/binder/ProcessState.h b/libs/binder/include/binder/ProcessState.h index ce578e3f5c..81391e96e7 100644 --- a/libs/binder/include/binder/ProcessState.h +++ b/libs/binder/include/binder/ProcessState.h @@ -55,7 +55,7 @@ public: // For main functions - dangerous for libraries to use void startThreadPool(); - bool becomeContextManager(); + [[nodiscard]] bool becomeContextManager(); sp<IBinder> getStrongProxyForHandle(int32_t handle); void expungeHandle(int32_t handle, IBinder* binder); |