summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.cpp
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-07-17 13:54:20 -0700
committerEino-Ville Talvala <etalvala@google.com>2012-07-17 13:54:20 -0700
commitf5926136ad328e95a79336b051d6f853443eaab9 (patch)
tree196d7d93abbd276f70839291eb711094d345f8c7 /services/camera/libcameraservice/CameraService.cpp
parentdcda3b325f465aa6ec2be11db1c56c8a5e867f33 (diff)
downloadframeworks_av-f5926136ad328e95a79336b051d6f853443eaab9.zip
frameworks_av-f5926136ad328e95a79336b051d6f853443eaab9.tar.gz
frameworks_av-f5926136ad328e95a79336b051d6f853443eaab9.tar.bz2
CameraService: Add more information to service dump.
Add dumpsys information even when there's no active client. Including: - Camera module version / name / author - Number of camera devices - Static information for each device Change-Id: Ib97e325f6be5f989b342d24f1ae17aa9e796f8ed
Diffstat (limited to 'services/camera/libcameraservice/CameraService.cpp')
-rw-r--r--services/camera/libcameraservice/CameraService.cpp61
1 files changed, 57 insertions, 4 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 912ee4a..a83c28f 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -429,17 +429,69 @@ status_t CameraService::dump(int fd, const Vector<String16>& args) {
// failed to lock - CameraService is probably deadlocked
if (!locked) {
result.append("CameraService may be deadlocked\n");
+ write(fd, result.string(), result.size());
}
bool hasClient = false;
+ if (!mModule) {
+ result = String8::format("No camera module available!\n");
+ write(fd, result.string(), result.size());
+ return NO_ERROR;
+ }
+
+ result = String8::format("Camera module HAL API version: 0x%x\n",
+ mModule->common.hal_api_version);
+ result.appendFormat("Camera module API version: 0x%x\n",
+ mModule->common.module_api_version);
+ result.appendFormat("Camera module name: %s\n",
+ mModule->common.name);
+ result.appendFormat("Camera module author: %s\n",
+ mModule->common.author);
+ result.appendFormat("Number of camera devices: %d\n\n", mNumberOfCameras);
+ write(fd, result.string(), result.size());
for (int i = 0; i < mNumberOfCameras; i++) {
+ result = String8::format("Camera %d static information:\n", i);
+ camera_info info;
+
+ status_t rc = mModule->get_camera_info(i, &info);
+ if (rc != OK) {
+ result.appendFormat(" Error reading static information!\n");
+ write(fd, result.string(), result.size());
+ } else {
+ result.appendFormat(" Facing: %s\n",
+ info.facing == CAMERA_FACING_BACK ? "BACK" : "FRONT");
+ result.appendFormat(" Orientation: %d\n", info.orientation);
+ int deviceVersion;
+ if (mModule->common.module_api_version <
+ CAMERA_MODULE_API_VERSION_2_0) {
+ deviceVersion = CAMERA_DEVICE_API_VERSION_1_0;
+ } else {
+ deviceVersion = info.device_version;
+ }
+ result.appendFormat(" Device version: 0x%x\n", deviceVersion);
+ if (deviceVersion >= CAMERA_DEVICE_API_VERSION_2_0) {
+ result.appendFormat(" Device static metadata:\n");
+ write(fd, result.string(), result.size());
+ dump_camera_metadata(info.static_camera_characteristics, fd, 2);
+ } else {
+ write(fd, result.string(), result.size());
+ }
+ }
+
sp<Client> client = mClient[i].promote();
- if (client == 0) continue;
+ if (client == 0) {
+ result = String8::format(" Device is closed, no client instance\n");
+ write(fd, result.string(), result.size());
+ continue;
+ }
hasClient = true;
+ result = String8::format(" Device is open. Client instance dump:\n");
+ write(fd, result.string(), result.size());
client->dump(fd, args);
}
if (!hasClient) {
- result.append("No camera clients yet.\n");
+ result = String8::format("\nNo active camera clients yet.\n");
+ write(fd, result.string(), result.size());
}
if (locked) mServiceLock.unlock();
@@ -451,11 +503,12 @@ status_t CameraService::dump(int fd, const Vector<String16>& args) {
if (args[i] == verboseOption) {
String8 levelStr(args[i+1]);
int level = atoi(levelStr.string());
- result.appendFormat("Setting log level to %d.\n", level);
+ result = String8::format("\nSetting log level to %d.\n", level);
setLogLevel(level);
+ write(fd, result.string(), result.size());
}
}
- write(fd, result.string(), result.size());
+
}
return NO_ERROR;
}