diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2014-09-18 17:24:22 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2014-09-18 17:24:22 -0700 |
commit | b9d2f3333369183344aa89c7be1e643a44296d48 (patch) | |
tree | 12ecc9c05cc39b79720a120a290a47256278bf25 /services/camera | |
parent | 67489d2f5668441a36cb1f1157e80ec8684023bf (diff) | |
download | frameworks_av-b9d2f3333369183344aa89c7be1e643a44296d48.zip frameworks_av-b9d2f3333369183344aa89c7be1e643a44296d48.tar.gz frameworks_av-b9d2f3333369183344aa89c7be1e643a44296d48.tar.bz2 |
CameraService: Add client name/pid to device open/close logging.
Bug: 15672812
Change-Id: I1162c6d9d0a1eea1dd32949a04c295b4941d2602
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/common/Camera2ClientBase.cpp | 9 | ||||
-rw-r--r-- | services/camera/libcameraservice/common/Camera2ClientBase.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.cpp b/services/camera/libcameraservice/common/Camera2ClientBase.cpp index 24d173c..d6db151 100644 --- a/services/camera/libcameraservice/common/Camera2ClientBase.cpp +++ b/services/camera/libcameraservice/common/Camera2ClientBase.cpp @@ -57,8 +57,10 @@ Camera2ClientBase<TClientBase>::Camera2ClientBase( mSharedCameraCallbacks(remoteCallback), mDeviceVersion(cameraService->getDeviceVersion(cameraId)) { - ALOGI("Camera %d: Opened", cameraId); + ALOGI("Camera %d: Opened. Client: %s (PID %d, UID %d)", cameraId, + String8(clientPackageName).string(), clientPid, clientUid); + mInitialClientPid = clientPid; mDevice = CameraDeviceFactory::createDevice(cameraId); LOG_ALWAYS_FATAL_IF(mDevice == 0, "Device should never be NULL here."); } @@ -114,7 +116,10 @@ Camera2ClientBase<TClientBase>::~Camera2ClientBase() { disconnect(); - ALOGI("Closed Camera %d", TClientBase::mCameraId); + ALOGI("Closed Camera %d. Client was: %s (PID %d, UID %u)", + TClientBase::mCameraId, + String8(TClientBase::mClientPackageName).string(), + mInitialClientPid, TClientBase::mClientUid); } template <typename TClientBase> diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.h b/services/camera/libcameraservice/common/Camera2ClientBase.h index f57d204..d198e4e 100644 --- a/services/camera/libcameraservice/common/Camera2ClientBase.h +++ b/services/camera/libcameraservice/common/Camera2ClientBase.h @@ -107,6 +107,9 @@ public: protected: + // The PID provided in the constructor call + pid_t mInitialClientPid; + virtual sp<IBinder> asBinderWrapper() { return IInterface::asBinder(); } |