Loading include/binder/AppOpsManager.h +3 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,9 @@ class AppOpsManager { public: enum { MODE_ALLOWED = 0, MODE_IGNORED = 1, MODE_ERRORED = 2 MODE_ALLOWED = IAppOpsService::MODE_ALLOWED, MODE_IGNORED = IAppOpsService::MODE_IGNORED, MODE_ERRORED = IAppOpsService::MODE_ERRORED }; enum { Loading include/binder/IAppOpsService.h +6 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,12 @@ public: START_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+4, STOP_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+5 }; enum { MODE_ALLOWED = 0, MODE_IGNORED = 1, MODE_ERRORED = 2 }; }; // ---------------------------------------------------------------------- Loading @@ -64,4 +70,3 @@ public: }; // namespace android #endif // ANDROID_IAPP_OPS_SERVICE_H libs/binder/AppOpsManager.cpp +14 −16 Original line number Diff line number Diff line Loading @@ -32,8 +32,7 @@ sp<IAppOpsService> AppOpsManager::getService() int64_t startTime = 0; mLock.lock(); sp<IAppOpsService> service = mService; while (true) { if (service == NULL || !service->asBinder()->isBinderAlive()) { while (service == NULL || !service->asBinder()->isBinderAlive()) { sp<IBinder> binder = defaultServiceManager()->checkService(_appops); if (binder == NULL) { // Wait for the app ops service to come back... Loading @@ -50,7 +49,6 @@ sp<IAppOpsService> AppOpsManager::getService() mService = service; } } } mLock.unlock(); return service; } Loading libs/binder/IAppOpsService.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -45,8 +45,8 @@ public: data.writeString16(packageName); remote()->transact(CHECK_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return 0; return reply.readInt32() != 0; if (reply.readExceptionCode() != 0) return MODE_ERRORED; return reply.readInt32(); } virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName) { Loading @@ -57,8 +57,8 @@ public: data.writeString16(packageName); remote()->transact(NOTE_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return 0; return reply.readInt32() != 0; if (reply.readExceptionCode() != 0) return MODE_ERRORED; return reply.readInt32(); } virtual int32_t startOperation(int32_t code, int32_t uid, const String16& packageName) { Loading @@ -69,8 +69,8 @@ public: data.writeString16(packageName); remote()->transact(START_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return 0; return reply.readInt32() != 0; if (reply.readExceptionCode() != 0) return MODE_ERRORED; return reply.readInt32(); } virtual void finishOperation(int32_t code, int32_t uid, const String16& packageName) { Loading Loading
include/binder/AppOpsManager.h +3 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,9 @@ class AppOpsManager { public: enum { MODE_ALLOWED = 0, MODE_IGNORED = 1, MODE_ERRORED = 2 MODE_ALLOWED = IAppOpsService::MODE_ALLOWED, MODE_IGNORED = IAppOpsService::MODE_IGNORED, MODE_ERRORED = IAppOpsService::MODE_ERRORED }; enum { Loading
include/binder/IAppOpsService.h +6 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,12 @@ public: START_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+4, STOP_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+5 }; enum { MODE_ALLOWED = 0, MODE_IGNORED = 1, MODE_ERRORED = 2 }; }; // ---------------------------------------------------------------------- Loading @@ -64,4 +70,3 @@ public: }; // namespace android #endif // ANDROID_IAPP_OPS_SERVICE_H
libs/binder/AppOpsManager.cpp +14 −16 Original line number Diff line number Diff line Loading @@ -32,8 +32,7 @@ sp<IAppOpsService> AppOpsManager::getService() int64_t startTime = 0; mLock.lock(); sp<IAppOpsService> service = mService; while (true) { if (service == NULL || !service->asBinder()->isBinderAlive()) { while (service == NULL || !service->asBinder()->isBinderAlive()) { sp<IBinder> binder = defaultServiceManager()->checkService(_appops); if (binder == NULL) { // Wait for the app ops service to come back... Loading @@ -50,7 +49,6 @@ sp<IAppOpsService> AppOpsManager::getService() mService = service; } } } mLock.unlock(); return service; } Loading
libs/binder/IAppOpsService.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -45,8 +45,8 @@ public: data.writeString16(packageName); remote()->transact(CHECK_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return 0; return reply.readInt32() != 0; if (reply.readExceptionCode() != 0) return MODE_ERRORED; return reply.readInt32(); } virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName) { Loading @@ -57,8 +57,8 @@ public: data.writeString16(packageName); remote()->transact(NOTE_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return 0; return reply.readInt32() != 0; if (reply.readExceptionCode() != 0) return MODE_ERRORED; return reply.readInt32(); } virtual int32_t startOperation(int32_t code, int32_t uid, const String16& packageName) { Loading @@ -69,8 +69,8 @@ public: data.writeString16(packageName); remote()->transact(START_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return 0; return reply.readInt32() != 0; if (reply.readExceptionCode() != 0) return MODE_ERRORED; return reply.readInt32(); } virtual void finishOperation(int32_t code, int32_t uid, const String16& packageName) { Loading