diff options
Diffstat (limited to 'libs/binder/IAppOpsService.cpp')
-rw-r--r-- | libs/binder/IAppOpsService.cpp | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/libs/binder/IAppOpsService.cpp b/libs/binder/IAppOpsService.cpp index 7384466b55..a5555a304f 100644 --- a/libs/binder/IAppOpsService.cpp +++ b/libs/binder/IAppOpsService.cpp @@ -47,13 +47,16 @@ public: } virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName, - const std::unique_ptr<String16>& featureId) { + const std::unique_ptr<String16>& featureId, bool shouldCollectAsyncNotedOp, + const String16& message) { Parcel data, reply; data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor()); data.writeInt32(code); data.writeInt32(uid); data.writeString16(packageName); data.writeString16(featureId); + data.writeInt32(shouldCollectAsyncNotedOp ? 1 : 0); + data.writeString16(message); remote()->transact(NOTE_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return MODE_ERRORED; @@ -62,7 +65,7 @@ public: virtual int32_t startOperation(const sp<IBinder>& token, int32_t code, int32_t uid, const String16& packageName, const std::unique_ptr<String16>& featureId, - bool startIfModeDefault) { + bool startIfModeDefault, bool shouldCollectAsyncNotedOp, const String16& message) { Parcel data, reply; data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor()); data.writeStrongBinder(token); @@ -71,6 +74,8 @@ public: data.writeString16(packageName); data.writeString16(featureId); data.writeInt32(startIfModeDefault ? 1 : 0); + data.writeInt32(shouldCollectAsyncNotedOp ? 1 : 0); + data.writeString16(message); remote()->transact(START_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return MODE_ERRORED; @@ -139,20 +144,6 @@ public: remote()->transact(SET_CAMERA_AUDIO_RESTRICTION_TRANSACTION, data, &reply); } - virtual void noteAsyncOp(const std::unique_ptr<String16>& callingPackageName, int32_t uid, - const String16& packageName, int32_t opCode, const std::unique_ptr<String16>& featureId, - const String16& message) { - Parcel data, reply; - data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor()); - data.writeString16(callingPackageName); - data.writeInt32(uid); - data.writeString16(packageName); - data.writeInt32(opCode); - data.writeString16(featureId); - data.writeString16(message); - remote()->transact(NOTE_ASYNC_OP_TRANSACTION, data, &reply); - } - virtual bool shouldCollectNotes(int32_t opCode) { Parcel data, reply; data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor()); @@ -193,7 +184,10 @@ status_t BnAppOpsService::onTransact( String16 packageName = data.readString16(); std::unique_ptr<String16> featureId; data.readString16(&featureId); - int32_t res = noteOperation(code, uid, packageName, featureId); + bool shouldCollectAsyncNotedOp = data.readInt32() == 1; + String16 message = data.readString16(); + int32_t res = noteOperation(code, uid, packageName, featureId, + shouldCollectAsyncNotedOp, message); reply->writeNoException(); reply->writeInt32(res); return NO_ERROR; @@ -207,8 +201,10 @@ status_t BnAppOpsService::onTransact( std::unique_ptr<String16> featureId; data.readString16(&featureId); bool startIfModeDefault = data.readInt32() == 1; + bool shouldCollectAsyncNotedOp = data.readInt32() == 1; + String16 message = data.readString16(); int32_t res = startOperation(token, code, uid, packageName, featureId, - startIfModeDefault); + startIfModeDefault, shouldCollectAsyncNotedOp, message); reply->writeNoException(); reply->writeInt32(res); return NO_ERROR; @@ -267,20 +263,6 @@ status_t BnAppOpsService::onTransact( reply->writeNoException(); return NO_ERROR; } break; - case NOTE_ASYNC_OP_TRANSACTION: { - CHECK_INTERFACE(IAppOpsService, data, reply); - std::unique_ptr<String16> callingPackageName; - data.readString16(&callingPackageName); - int32_t uid = data.readInt32(); - String16 packageName = data.readString16(); - int32_t opCode = data.readInt32(); - std::unique_ptr<String16> featureId; - data.readString16(&featureId); - String16 message = data.readString16(); - noteAsyncOp(callingPackageName, uid, packageName, opCode, featureId, message); - reply->writeNoException(); - return NO_ERROR; - } break; case SHOULD_COLLECT_NOTES_TRANSACTION: { CHECK_INTERFACE(IAppOpsService, data, reply); int32_t opCode = data.readInt32(); |