diff options
Diffstat (limited to 'libs/binder/IAppOpsService.cpp')
-rw-r--r-- | libs/binder/IAppOpsService.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/libs/binder/IAppOpsService.cpp b/libs/binder/IAppOpsService.cpp index cd78866624..ee0cd6206e 100644 --- a/libs/binder/IAppOpsService.cpp +++ b/libs/binder/IAppOpsService.cpp @@ -50,15 +50,16 @@ public: virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName, const std::optional<String16>& attributionTag, bool shouldCollectAsyncNotedOp, - const String16& message) { + const String16& message, bool shouldCollectMessage) { Parcel data, reply; data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor()); data.writeInt32(code); data.writeInt32(uid); data.writeString16(packageName); data.writeString16(attributionTag); - data.writeInt32(shouldCollectAsyncNotedOp ? 1 : 0); + data.writeBool(shouldCollectAsyncNotedOp); data.writeString16(message); + data.writeBool(shouldCollectMessage); remote()->transact(NOTE_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return MODE_ERRORED; @@ -67,7 +68,8 @@ public: virtual int32_t startOperation(const sp<IBinder>& token, int32_t code, int32_t uid, const String16& packageName, const std::optional<String16>& attributionTag, - bool startIfModeDefault, bool shouldCollectAsyncNotedOp, const String16& message) { + bool startIfModeDefault, bool shouldCollectAsyncNotedOp, const String16& message, + bool shouldCollectMessage) { Parcel data, reply; data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor()); data.writeStrongBinder(token); @@ -75,9 +77,10 @@ public: data.writeInt32(uid); data.writeString16(packageName); data.writeString16(attributionTag); - data.writeInt32(startIfModeDefault ? 1 : 0); - data.writeInt32(shouldCollectAsyncNotedOp ? 1 : 0); + data.writeBool(startIfModeDefault); + data.writeBool(shouldCollectAsyncNotedOp); data.writeString16(message); + data.writeBool(shouldCollectMessage); remote()->transact(START_OPERATION_TRANSACTION, data, &reply); // fail on exception if (reply.readExceptionCode() != 0) return MODE_ERRORED; @@ -186,10 +189,11 @@ status_t BnAppOpsService::onTransact( String16 packageName = data.readString16(); std::optional<String16> attributionTag; data.readString16(&attributionTag); - bool shouldCollectAsyncNotedOp = data.readInt32() == 1; + bool shouldCollectAsyncNotedOp = data.readBool(); String16 message = data.readString16(); + bool shouldCollectMessage = data.readBool(); int32_t res = noteOperation(code, uid, packageName, attributionTag, - shouldCollectAsyncNotedOp, message); + shouldCollectAsyncNotedOp, message, shouldCollectMessage); reply->writeNoException(); reply->writeInt32(res); return NO_ERROR; @@ -202,11 +206,12 @@ status_t BnAppOpsService::onTransact( String16 packageName = data.readString16(); std::optional<String16> attributionTag; data.readString16(&attributionTag); - bool startIfModeDefault = data.readInt32() == 1; - bool shouldCollectAsyncNotedOp = data.readInt32() == 1; + bool startIfModeDefault = data.readBool(); + bool shouldCollectAsyncNotedOp = data.readBool(); String16 message = data.readString16(); + bool shouldCollectMessage = data.readBool(); int32_t res = startOperation(token, code, uid, packageName, attributionTag, - startIfModeDefault, shouldCollectAsyncNotedOp, message); + startIfModeDefault, shouldCollectAsyncNotedOp, message, shouldCollectMessage); reply->writeNoException(); reply->writeInt32(res); return NO_ERROR; |