Fix defaultServiceManager() locking and retry loop.
Use a static instead of double-checked locking.
Bug: 142838845
Test: builds
Change-Id: I0b42539cae70a70c6a23798c27f6b088bb5d3b40
diff --git a/libs/binder/include/binder/IServiceManager.h b/libs/binder/include/binder/IServiceManager.h
index 31f022d..1d520c1 100644
--- a/libs/binder/include/binder/IServiceManager.h
+++ b/libs/binder/include/binder/IServiceManager.h
@@ -102,6 +102,9 @@
/**
* Directly set the default service manager. Only used for testing.
+ * Note that the caller is responsible for caling this method
+ * *before* any call to defaultServiceManager(); if the latter is
+ * called first, setDefaultServiceManager() will abort.
*/
void setDefaultServiceManager(const sp<IServiceManager>& sm);