summaryrefslogtreecommitdiff
path: root/libs/binder/AppOpsManager.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2019-09-09 16:07:52 -0700
committer Steven Moreland <smoreland@google.com> 2019-09-09 16:14:53 -0700
commitc326a94d15828aee6a9261763bb40b82824f0c6c (patch)
treee97acc0d4f4f9457db2683525f7c21ec7101db3c /libs/binder/AppOpsManager.cpp
parent95ad8b142447acabbce0845a84b99dc37632e2b4 (diff)
libbinder: Hide AppOpsManager/Service from vendor.
Vendor apps can still use these behind stable SDK or NDK APIs as applicable, but native code on the vendor image can't use these APIs because they are using /dev/vndbinder and have an incompatible copy of libbinder. Since no vendor binary is serving this, removing extra pound defines and making the vendor version of this library slightly smaller. Bug: 124524556 Test: builds (no vendor code has added dependencies on this yet) Change-Id: Idf01641d4b340ca6fe33c181969507ec071ef930
Diffstat (limited to 'libs/binder/AppOpsManager.cpp')
-rw-r--r--libs/binder/AppOpsManager.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/libs/binder/AppOpsManager.cpp b/libs/binder/AppOpsManager.cpp
index e2af01c161..711fed96a1 100644
--- a/libs/binder/AppOpsManager.cpp
+++ b/libs/binder/AppOpsManager.cpp
@@ -32,7 +32,6 @@ namespace android {
namespace {
-#ifndef __ANDROID_VNDK__
#if defined(__BRILLO__)
// Because Brillo has no application model, security policy is managed
// statically (at build time) with SELinux controls.
@@ -41,17 +40,13 @@ const int APP_OPS_MANAGER_UNAVAILABLE_MODE = AppOpsManager::MODE_ALLOWED;
#else
const int APP_OPS_MANAGER_UNAVAILABLE_MODE = AppOpsManager::MODE_IGNORED;
#endif // defined(__BRILLO__)
-#endif // __ANDROID_VNDK__
} // namespace
static String16 _appops("appops");
-#ifndef __ANDROID_VNDK__
static pthread_mutex_t gTokenMutex = PTHREAD_MUTEX_INITIALIZER;
-#endif // __ANDROID_VNDK__
static sp<IBinder> gToken;
-#ifndef __ANDROID_VNDK__
static const sp<IBinder>& getToken(const sp<IAppOpsService>& service) {
pthread_mutex_lock(&gTokenMutex);
if (gToken == nullptr || gToken->pingBinder() != NO_ERROR) {
@@ -60,17 +55,12 @@ static const sp<IBinder>& getToken(const sp<IAppOpsService>& service) {
pthread_mutex_unlock(&gTokenMutex);
return gToken;
}
-#endif // __ANDROID_VNDK__
thread_local uint64_t notedAppOpsInThisBinderTransaction[2];
thread_local int32_t uidOfThisBinderTransaction = -1;
// Whether an appop should be collected: 0 == not initialized, 1 == don't note, 2 == note
-#ifndef __ANDROID_VNDK__
uint8_t appOpsToNote[AppOpsManager::_NUM_OP] = {0};
-#else
-uint8_t appOpsToNote[128] = {0};
-#endif // __ANDROID_VNDK__
AppOpsManager::AppOpsManager()
{
@@ -108,7 +98,6 @@ sp<IAppOpsService> AppOpsManager::getService()
}
#endif // defined(__BRILLO__)
-#ifndef __ANDROID_VNDK__
int32_t AppOpsManager::checkOp(int32_t op, int32_t uid, const String16& callingPackage)
{
sp<IAppOpsService> service = getService();
@@ -200,8 +189,6 @@ void AppOpsManager::setCameraAudioRestriction(int32_t mode) {
}
}
-#endif // __ANDROID_VNDK__
-
bool AppOpsManager::shouldCollectNotes(int32_t opcode) {
sp<IAppOpsService> service = getService();
if (service != nullptr) {