Add shouldCollectMessage parameter to AppOpsManager calls from native code.
Bug: 161362515
Test: manually verified
Change-Id: I05894dee10ba2cab587aea5d02773feae1085e34
diff --git a/libs/binder/AppOpsManager.cpp b/libs/binder/AppOpsManager.cpp
index 1c6b491..de42f36 100644
--- a/libs/binder/AppOpsManager.cpp
+++ b/libs/binder/AppOpsManager.cpp
@@ -22,6 +22,7 @@
#include <utils/SystemClock.h>
#include <sys/types.h>
+#include <private/android_filesystem_config.h>
#ifdef LOG_TAG
#undef LOG_TAG
@@ -100,7 +101,7 @@
sp<IAppOpsService> service = getService();
int32_t mode = service != nullptr
? service->noteOperation(op, uid, callingPackage, attributionTag,
- shouldCollectNotes(op), message)
+ shouldCollectNotes(op), message, uid == AID_SYSTEM)
: AppOpsManager::MODE_IGNORED;
return mode;
@@ -118,7 +119,8 @@
sp<IAppOpsService> service = getService();
int32_t mode = service != nullptr
? service->startOperation(getClientId(), op, uid, callingPackage,
- attributionTag, startIfModeDefault, shouldCollectNotes(op), message)
+ attributionTag, startIfModeDefault, shouldCollectNotes(op), message,
+ uid == AID_SYSTEM)
: AppOpsManager::MODE_IGNORED;
return mode;