Camera: fix an issue regarding ndk/vndk availability callback
If NDK user only uses availability callback then no service connection
will be made. Thus, no availability callback will be posted to the user.
Also, the camera service used to unconditionally filter out the status
change, if the listener is vendor listener. So, VNDK user will never
receive the availability callback.
With this patch, availability callback routine explicitly makes
connection to the service, and the status change will be filtered from
the service properly using shouldSkipStatusUpdates().
Test: use availability callback only from jni sample, vendor sample
Change-Id: Ic1d5951e3ee3b24ffe19aa780c67a98db781545b
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 28bb781..266c83c 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -4686,8 +4686,7 @@
for (auto& listener : mListenerList) {
bool isVendorListener = listener->isVendorListener();
if (shouldSkipStatusUpdates(deviceKind, isVendorListener,
- listener->getListenerPid(), listener->getListenerUid()) ||
- isVendorListener) {
+ listener->getListenerPid(), listener->getListenerUid())) {
ALOGV("Skipping discovery callback for system-only camera device %s",
cameraId.c_str());
continue;