summaryrefslogtreecommitdiff
path: root/libs/binder/IServiceManager.cpp
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2018-04-17 13:56:46 +0900
committer Jiyong Park <jiyong@google.com> 2018-04-17 13:56:46 +0900
commit47f876b74be0a2d6d417f5ff385f85d835a97fe9 (patch)
tree933a23cdef6c20cdb6f6f99220a956a01051ef9b /libs/binder/IServiceManager.cpp
parent7e959e42d85b1ef75a32ab6d4a29efb7f556ffda (diff)
Hide some headers from libbinder to vendors
The headers that are related to system services are now hidden to vendors. Note that this does not break anything because vendors have already been disallowed to talk to system services via sepolicy. Their use of binder is strictly limited within themselves (via /dev/vndbinder). The hidden headers are now guarded with __ANDROID_VNDK__ and including them from vendors (or vendor variants of other VNDK libraries) will trigger a build-time error. Bug: 78113963 Test: m -j Test: devices boots to the UI Change-Id: I19be5ca024fc4081b7861d908d75758c1d956a83
Diffstat (limited to 'libs/binder/IServiceManager.cpp')
-rw-r--r--libs/binder/IServiceManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index 70f5108722..711143c34a 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -20,6 +20,9 @@
#include <utils/Log.h>
#include <binder/IPCThreadState.h>
+#ifndef __ANDROID_VNDK__
+#include <binder/IPermissionController.h>
+#endif
#include <binder/Parcel.h>
#include <utils/String8.h>
#include <utils/SystemClock.h>
@@ -48,6 +51,9 @@ sp<IServiceManager> defaultServiceManager()
return gDefaultServiceManager;
}
+#ifndef __ANDROID_VNDK__
+// IPermissionController is not accessible to vendors
+
bool checkCallingPermission(const String16& permission)
{
return checkCallingPermission(permission, NULL, NULL);
@@ -122,6 +128,8 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid)
}
}
+#endif //__ANDROID_VNDK__
+
// ----------------------------------------------------------------------
class BpServiceManager : public BpInterface<IServiceManager>