summaryrefslogtreecommitdiff
path: root/libs/binder/AppOpsManager.cpp
diff options
context:
space:
mode:
author Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2020-03-05 20:05:36 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2020-03-05 20:05:36 +0000
commit852425f28b10b15fbfcaa1ab89382149fa152373 (patch)
treef6ed8d84d571942d5696509a3a033116fefd4d77 /libs/binder/AppOpsManager.cpp
parent146ca44a4b8607dbe196dab61ac3a3737758e10a (diff)
parentc3cd70ffab6f9fb258b7a3021ae417bec2e5a6e8 (diff)
libbinder: remove __BRILLO__ carveouts am: 15a63a8b8f am: 55123c2637 am: c3cd70ffab
Change-Id: Iae421fa468d5b060c55d3492be77ef05dfc09b7e
Diffstat (limited to 'libs/binder/AppOpsManager.cpp')
-rw-r--r--libs/binder/AppOpsManager.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/libs/binder/AppOpsManager.cpp b/libs/binder/AppOpsManager.cpp
index b2a6f3bbe9..a22cf25671 100644
--- a/libs/binder/AppOpsManager.cpp
+++ b/libs/binder/AppOpsManager.cpp
@@ -30,19 +30,6 @@
namespace android {
-namespace {
-
-#if defined(__BRILLO__)
-// Because Brillo has no application model, security policy is managed
-// statically (at build time) with SELinux controls.
-// As a consequence, it also never runs the AppOpsManager service.
-const int APP_OPS_MANAGER_UNAVAILABLE_MODE = AppOpsManager::MODE_ALLOWED;
-#else
-const int APP_OPS_MANAGER_UNAVAILABLE_MODE = AppOpsManager::MODE_IGNORED;
-#endif // defined(__BRILLO__)
-
-} // namespace
-
static const sp<IBinder>& getClientId() {
static pthread_mutex_t gClientIdMutex = PTHREAD_MUTEX_INITIALIZER;
static sp<IBinder> gClientId;
@@ -65,10 +52,6 @@ AppOpsManager::AppOpsManager()
{
}
-#if defined(__BRILLO__)
-// There is no AppOpsService on Brillo
-sp<IAppOpsService> AppOpsManager::getService() { return NULL; }
-#else
sp<IAppOpsService> AppOpsManager::getService()
{
static String16 _appops("appops");
@@ -96,14 +79,13 @@ sp<IAppOpsService> AppOpsManager::getService()
}
return service;
}
-#endif // defined(__BRILLO__)
int32_t AppOpsManager::checkOp(int32_t op, int32_t uid, const String16& callingPackage)
{
sp<IAppOpsService> service = getService();
return service != nullptr
? service->checkOperation(op, uid, callingPackage)
- : APP_OPS_MANAGER_UNAVAILABLE_MODE;
+ : AppOpsManager::MODE_IGNORED;
}
int32_t AppOpsManager::checkAudioOpNoThrow(int32_t op, int32_t usage, int32_t uid,
@@ -111,7 +93,7 @@ int32_t AppOpsManager::checkAudioOpNoThrow(int32_t op, int32_t usage, int32_t ui
sp<IAppOpsService> service = getService();
return service != nullptr
? service->checkAudioOperation(op, usage, uid, callingPackage)
- : APP_OPS_MANAGER_UNAVAILABLE_MODE;
+ : AppOpsManager::MODE_IGNORED;
}
int32_t AppOpsManager::noteOp(int32_t op, int32_t uid, const String16& callingPackage) {
@@ -125,7 +107,7 @@ int32_t AppOpsManager::noteOp(int32_t op, int32_t uid, const String16& callingPa
int32_t mode = service != nullptr
? service->noteOperation(op, uid, callingPackage, featureId, shouldCollectNotes(op),
message)
- : APP_OPS_MANAGER_UNAVAILABLE_MODE;
+ : AppOpsManager::MODE_IGNORED;
return mode;
}
@@ -143,7 +125,7 @@ int32_t AppOpsManager::startOpNoThrow(int32_t op, int32_t uid, const String16& c
int32_t mode = service != nullptr
? service->startOperation(getClientId(), op, uid, callingPackage,
featureId, startIfModeDefault, shouldCollectNotes(op), message)
- : APP_OPS_MANAGER_UNAVAILABLE_MODE;
+ : AppOpsManager::MODE_IGNORED;
return mode;
}