diff options
author | 2019-09-06 11:01:18 -0700 | |
---|---|---|
committer | 2019-10-09 14:38:15 -0700 | |
commit | b13018865ef7b1a7b4f59bafe70b6d93069e97ab (patch) | |
tree | 01617c9e199654374c3f6ed5cf5387d6a1c03872 /libs/binder/IAppOpsService.cpp | |
parent | b92c27b6c019c5b9bf4f8b695535e26e70fd1b1b (diff) |
Note appOps with featureIds from native code
Test: atest CtsAppOpsTestCases
Bug: 136595429
Change-Id: I31cc35134035d19aa7b98567fd998ff7f406b271
Diffstat (limited to 'libs/binder/IAppOpsService.cpp')
-rw-r--r-- | libs/binder/IAppOpsService.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/binder/IAppOpsService.cpp b/libs/binder/IAppOpsService.cpp index 6c16c2d044..9760e135a1 100644 --- a/libs/binder/IAppOpsService.cpp +++ b/libs/binder/IAppOpsService.cpp @@ -145,7 +145,8 @@ public: } virtual void noteAsyncOp(const String16& callingPackageName, int32_t uid, - const String16& packageName, int32_t opCode, const String16& message) { + const String16& packageName, int32_t opCode, const String16& featureId, + const String16& message) { Parcel data, reply; data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor()); @@ -166,6 +167,14 @@ public: } data.writeInt32(opCode); + + // Convert empty featureId into null string + if (featureId.size() != 0) { + data.writeString16(featureId); + } else { + data.writeString16(nullptr, 0); + } + data.writeString16(message); remote()->transact(NOTE_ASYNC_OP_TRANSACTION, data, &reply); } @@ -291,8 +300,9 @@ status_t BnAppOpsService::onTransact( int32_t uid = data.readInt32(); String16 packageName = data.readString16(); int32_t opCode = data.readInt32(); + String16 featureId = data.readString16(); String16 message = data.readString16(); - noteAsyncOp(callingPackageName, uid, packageName, opCode, message); + noteAsyncOp(callingPackageName, uid, packageName, opCode, featureId, message); reply->writeNoException(); return NO_ERROR; } break; |