Loading libs/binder/AppOpsManager.cpp +4 −22 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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"); Loading Loading @@ -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, Loading @@ -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) { Loading @@ -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; } Loading @@ -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; } Loading Loading
libs/binder/AppOpsManager.cpp +4 −22 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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"); Loading Loading @@ -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, Loading @@ -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) { Loading @@ -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; } Loading @@ -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; } Loading