Merge "Avoid waiting from polling binder threads" am: 29e3092879
am: 6b80a2706f

Change-Id: I3297cbab9d819db117e64a669bd868a02b6b033c
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index ef86f99..4bdeb6e 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -485,8 +485,7 @@
         // that thread, it will block forever because we hung up the one and only
         // binder thread on a condition variable that can only be notified by an
         // incoming binder call.
-        if (ProcessState::self()->getMaxThreads() <= 1 &&
-                IPCThreadState::self()->isLooperThread()) {
+        if (IPCThreadState::self()->isOnlyBinderThread()) {
             LOG(WARNING) << "Can't efficiently wait for " << mInterfaceName << "/"
                          << mInstanceName << ", because we are called from "
                          << "the only binder thread in this process.";