IQService: Remove process name in debug logs
Needed to support new SElinux policy. Remove process name in debug logs.
CRs-Fixed: 1011165
Change-Id: I561ded3b957a8f1bb5bd176c6f34b9b33c4946da
diff --git a/libqservice/IQService.cpp b/libqservice/IQService.cpp
index e4aee7a..6545427 100644
--- a/libqservice/IQService.cpp
+++ b/libqservice/IQService.cpp
@@ -79,8 +79,6 @@
// ----------------------------------------------------------------------
-static void getProcName(int pid, char *buf, int size);
-
status_t BnQService::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
@@ -89,10 +87,6 @@
IPCThreadState* ipc = IPCThreadState::self();
const int callerPid = ipc->getCallingPid();
const int callerUid = ipc->getCallingUid();
- const int MAX_BUF_SIZE = 1024;
- char callingProcName[MAX_BUF_SIZE] = {0};
-
- getProcName(callerPid, callingProcName, MAX_BUF_SIZE);
const bool permission = (callerUid == AID_MEDIA ||
callerUid == AID_GRAPHICS ||
@@ -102,9 +96,8 @@
if (code == CONNECT_HWC_CLIENT) {
CHECK_INTERFACE(IQService, data, reply);
if(callerUid != AID_GRAPHICS) {
- ALOGE("display.qservice CONNECT_HWC_CLIENT access denied: \
- pid=%d uid=%d process=%s",
- callerPid, callerUid, callingProcName);
+ ALOGE("display.qservice CONNECT_HWC_CLIENT access denied: pid=%d uid=%d",
+ callerPid, callerUid);
return PERMISSION_DENIED;
}
sp<IQClient> client =
@@ -114,9 +107,8 @@
} else if(code == CONNECT_HDMI_CLIENT) {
CHECK_INTERFACE(IQService, data, reply);
if(callerUid != AID_SYSTEM && callerUid != AID_ROOT) {
- ALOGE("display.qservice CONNECT_HDMI_CLIENT access denied: \
- pid=%d uid=%d process=%s",
- callerPid, callerUid, callingProcName);
+ ALOGE("display.qservice CONNECT_HDMI_CLIENT access denied: pid=%d uid=%d",
+ callerPid, callerUid);
return PERMISSION_DENIED;
}
sp<IQHDMIClient> client =
@@ -125,9 +117,8 @@
return NO_ERROR;
} else if (code > COMMAND_LIST_START && code < COMMAND_LIST_END) {
if(!permission) {
- ALOGE("display.qservice access denied: command=%d\
- pid=%d uid=%d process=%s", code, callerPid,
- callerUid, callingProcName);
+ ALOGE("display.qservice access denied: command=%d pid=%d uid=%d",
+ code, callerPid, callerUid);
return PERMISSION_DENIED;
}
CHECK_INTERFACE(IQService, data, reply);
@@ -138,20 +129,4 @@
}
}
-//Helper
-static void getProcName(int pid, char *buf, int size) {
- int fd = -1;
- snprintf(buf, size, "/proc/%d/cmdline", pid);
- fd = open(buf, O_RDONLY);
- if (fd < 0) {
- strlcpy(buf, "Unknown", size);
- } else {
- ssize_t len = read(fd, buf, size - 1);
- if (len >= 0)
- buf[len] = 0;
-
- close(fd);
- }
-}
-
}; // namespace qService