CameraService: don't skip device dump when there is no client
We shouldn't skip the device metadata dump when the camera is not
in use.
Test: adb shell dumpsys media.camera works
Bug: 35125905
Change-Id: I26e2a612efa55b3289adb160c90d3fbc95bb4085
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 579e87a..b97fece 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -2793,23 +2793,23 @@
}
auto clientDescriptor = mActiveClientManager.get(cameraId);
- if (clientDescriptor == nullptr) {
+ if (clientDescriptor != nullptr) {
+ dprintf(fd, " Device %s is open. Client instance dump:\n",
+ cameraId.string());
+ dprintf(fd, " Client priority score: %d state: %d\n",
+ clientDescriptor->getPriority().getScore(),
+ clientDescriptor->getPriority().getState());
+ dprintf(fd, " Client PID: %d\n", clientDescriptor->getOwnerId());
+
+ auto client = clientDescriptor->getValue();
+ dprintf(fd, " Client package: %s\n",
+ String8(client->getPackageName()).string());
+
+ client->dumpClient(fd, args);
+ } else {
dprintf(fd, " Device %s is closed, no client instance\n",
cameraId.string());
- continue;
}
- dprintf(fd, " Device %s is open. Client instance dump:\n",
- cameraId.string());
- dprintf(fd, " Client priority score: %d state: %d\n",
- clientDescriptor->getPriority().getScore(),
- clientDescriptor->getPriority().getState());
- dprintf(fd, " Client PID: %d\n", clientDescriptor->getOwnerId());
-
- auto client = clientDescriptor->getValue();
- dprintf(fd, " Client package: %s\n",
- String8(client->getPackageName()).string());
-
- client->dumpClient(fd, args);
if (mModule != nullptr) {
dprintf(fd, "== Camera HAL device %s static information: ==\n", cameraId.string());