Android8.1 相机调用getCameraInfo时出现anr

开发高通相机应用过程中会遇到getCameraInfo时系统anr,经过分析修改如下:

[sdm660_8.1/frameworks/av/.git] / services / camera / libcameraservice / CameraService.cpp
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 09fea41..0dd5cff 100644 (file)
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -456,7 +456,7 @@ Status CameraService::getNumberOfCameras(int32_t type, int32_t* numCameras) {
 Status CameraService::getCameraInfo(int cameraId,
         CameraInfo* cameraInfo) {
     ATRACE_CALL();
-    Mutex::Autolock l(mServiceLock);
+   // Mutex::Autolock l(mServiceLock); //delete-getCameraInfo anr-#7295-zhoujy-181214

 
     if (!mInitialized) {
         return STATUS_ERROR(ERROR_DISCONNECTED,

你可能感兴趣的:(android)