Additional operation check when enabling read logs.
Vold now does not check caller's permission, but only accepts
transactions from system_server. And it's up to system server to do the
right thing and check permissions/appops.
Bug: b/152633648
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest
Test: adb shell appops set 1000 GET_USAGE_STATS deny
Change-Id: Id56c1673b135b72b3ec86e572aa4bcca3afc19ab
diff --git a/VoldNativeServiceValidation.cpp b/VoldNativeServiceValidation.cpp
index 2e21ace..ee1e65a 100644
--- a/VoldNativeServiceValidation.cpp
+++ b/VoldNativeServiceValidation.cpp
@@ -39,11 +39,10 @@
}
binder::Status CheckPermission(const char* permission) {
- pid_t pid;
- uid_t uid;
+ int32_t pid;
+ int32_t uid;
- if (checkCallingPermission(String16(permission), reinterpret_cast<int32_t*>(&pid),
- reinterpret_cast<int32_t*>(&uid))) {
+ if (checkCallingPermission(String16(permission), &pid, &uid)) {
return Ok();
} else {
return Exception(binder::Status::EX_SECURITY,