Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera service logs #1328

Open
wants to merge 1 commit into
base: celadon/r/mr0/stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
From 076cf06cea3be7cef4e3aba4ec2a3f4d8e8c8bb1 Mon Sep 17 00:00:00 2001
From: gkdeepa <[email protected]>
Date: Mon, 10 Jan 2022 10:10:12 +0530
Subject: [PATCH] enable camera service logs

Tracked-On:
---
.../camera/libcameraservice/CameraService.cpp | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index ed64d4ccc8..7c987fdbf5 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -16,7 +16,7 @@

#define LOG_TAG "CameraService"
#define ATRACE_TAG ATRACE_TAG_CAMERA
-//#define LOG_NDEBUG 0
+#define LOG_NDEBUG 0

#include <algorithm>
#include <climits>
@@ -185,7 +185,7 @@ void CameraService::onFirstRef()

status_t CameraService::enumerateProviders() {
status_t res;
-
+ALOGE("CameraService enumerateProviders enter");
std::vector<std::string> deviceIds;
{
Mutex::Autolock l(mServiceLock);
@@ -225,6 +225,7 @@ status_t CameraService::enumerateProviders() {
onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT);
}
}
+ALOGE("CameraService enumerateProviders exit");

return OK;
}
@@ -1086,7 +1087,7 @@ Status CameraService::validateConnectLocked(const String8& cameraId,
#endif // __BRILLO__

int callingPid = CameraThreadState::getCallingPid();
-
+ALOGE("callingPid %d",callingPid);
if (!mInitialized) {
ALOGE("CameraService::connect X (PID %d) rejected (camera HAL module not loaded)",
callingPid);
@@ -1134,9 +1135,10 @@ Status CameraService::validateClientPermissionsLocked(const String8& cameraId,
callingPid, callingUid, cameraId.string(),
clientName8.string(), clientUid, clientPid);
}
-
+ ALOGE("CameraService check the client PID");
// Check if we can trust clientPid
if (clientPid == USE_CALLING_PID) {
+ ALOGE("CameraService check the client PID clientPid == USE_CALLING_PID");
clientPid = callingPid;
} else if (!isTrustedCallingUid(callingUid)) {
ALOGE("CameraService::connect X (calling PID %d, calling UID %d) rejected "
@@ -1197,10 +1199,9 @@ Status CameraService::validateClientPermissionsLocked(const String8& cameraId,
// Only use passed in clientPid to check permission. Use calling PID as the client PID that's
// connected to camera service directly.
originalClientPid = clientPid;
- clientPid = callingPid;
-
+ clientPid = callingPid;
userid_t clientUserId = multiuser_get_user_id(clientUid);
-
+ ALOGE("%multiuser_get_user_id %d ",clientUserId);
// Only allow clients who are being used by the current foreground device user, unless calling
// from our own process OR the caller is using the cameraserver's HIDL interface.
if (getCurrentServingCall() != BinderCallType::HWBINDER && callingPid != getpid() &&
@@ -1217,6 +1218,7 @@ Status CameraService::validateClientPermissionsLocked(const String8& cameraId,
}

status_t CameraService::checkIfDeviceIsUsable(const String8& cameraId) const {
+ ALOGE("checkIfDeviceIsUsable ");
auto cameraState = getCameraState(cameraId);
int callingPid = CameraThreadState::getCallingPid();
if (cameraState == nullptr) {
--
2.17.1

Loading