cameraserver: Fix logic to skip callbacks for non HAL3 devices for vendor listeners.
Fixes regression caused by aosp/1152176, status update callbacks were being skipped
for non HAL3 devices for non vendor listeners. Non vendor listeners
should still get callbacks in case of non HAL3 devices.
Bug: 150180641
Test: Camera2 App
Test: CTS
Test: Use vendor clients of cameraserver
Test: Vendor testing
Merged-In: Ic31f71887b55f3d838ca35274a5f65802ea50584
Change-Id: Ifab0be4dac4b42f6923ce48ab57aeb0aaf26575b
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index c566485..595c3e8 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -3309,8 +3309,15 @@
Mutex::Autolock lock(mStatusListenerLock);
for (auto& listener : mListenerList) {
- if (!listener.first && (isHidden || !supportsHAL3)) {
- ALOGV("Skipping camera discovery callback for system-only / HAL1 camera %s",
+ bool isVendorListener = listener.first;
+ if (isVendorListener && !supportsHAL3) {
+ ALOGV("Skipping vendor listener camera discovery callback for HAL1 camera %s",
+ cameraId.c_str());
+ continue;
+ }
+
+ if (!isVendorListener && isHidden) {
+ ALOGV("Skipping camera discovery callback for system-only camera %s",
cameraId.c_str());
continue;
}