libbinder: ignore CallRestriction for magic 0 cmd
There is a special transaction required to make sure that the context
manager is setup before we get a reference to it. Since this is required
to use binder, it would prevent use of CallRestriction outside of
servicemanager.
Fixes: 167302413
Test: binderLibTest
Change-Id: I029e2a99013008a7c8614d63dc29df2889067d11
diff --git a/libs/binder/tests/binderLibTest.cpp b/libs/binder/tests/binderLibTest.cpp
index 145c099..c9cd102 100644
--- a/libs/binder/tests/binderLibTest.cpp
+++ b/libs/binder/tests/binderLibTest.cpp
@@ -599,6 +599,12 @@
ASSERT_TRUE(server != nullptr);
}
+TEST_F(BinderLibTest, AddManagerToManager) {
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<IBinder> binder = IInterface::asBinder(sm);
+ EXPECT_EQ(NO_ERROR, sm->addService(String16("binderLibTest-manager"), binder));
+}
+
TEST_F(BinderLibTest, DeathNotificationStrongRef)
{
status_t ret;