camera: Migrate ndk_vendor client implementation to AIDL.
With HIDL deprecated, cameraservice's vndk client interfaces have been
updated to using AIDL. This CL drops support for the HIDL vndk client
interface.
When vendor partition is rebuilt for future version of android, it
should automatically pick up the new new client implementation.
Cameraservice will continue to support both HIDL and AIDL vndk clients.
The changes are simple 1:1 mapping of HIDL interface logic with AIDL
interface logic.
Bug: 243593375
Test: atest ACameraNdkVendorTest
Change-Id: Ic03bbf4e275bb3eddc4ca4e322adc84fdf03f482
diff --git a/camera/ndk/NdkCameraDevice.cpp b/camera/ndk/NdkCameraDevice.cpp
index 691996b..8211671 100644
--- a/camera/ndk/NdkCameraDevice.cpp
+++ b/camera/ndk/NdkCameraDevice.cpp
@@ -22,18 +22,11 @@
#include <utils/Trace.h>
#include <camera/NdkCameraDevice.h>
+
#include "impl/ACameraCaptureSession.h"
using namespace android::acam;
-bool areWindowTypesEqual(ACameraWindowType *a, ACameraWindowType *b) {
-#ifdef __ANDROID_VNDK__
- return utils::isWindowNativeHandleEqual(a, b);
-#else
- return a == b;
-#endif
-}
-
EXPORT
camera_status_t ACameraDevice_close(ACameraDevice* device) {
ATRACE_CALL();
@@ -183,14 +176,15 @@
__FUNCTION__);
return ACAMERA_ERROR_INVALID_OPERATION;
}
- if (areWindowTypesEqual(out->mWindow, window)) {
+ if (out->isWindowEqual(window)) {
ALOGE("%s: Error trying to add the same window associated with the output configuration",
__FUNCTION__);
return ACAMERA_ERROR_INVALID_PARAMETER;
}
- auto insert = out->mSharedWindows.insert(window);
- camera_status_t ret = (insert.second) ? ACAMERA_OK : ACAMERA_ERROR_INVALID_PARAMETER;
+
+ bool insert = out->addSharedWindow(window);
+ camera_status_t ret = (insert) ? ACAMERA_OK : ACAMERA_ERROR_INVALID_PARAMETER;
return ret;
}
@@ -208,13 +202,13 @@
__FUNCTION__);
return ACAMERA_ERROR_INVALID_OPERATION;
}
- if (areWindowTypesEqual(out->mWindow, window)) {
+ if (out->isWindowEqual(window)) {
ALOGE("%s: Error trying to remove the same window associated with the output configuration",
__FUNCTION__);
return ACAMERA_ERROR_INVALID_PARAMETER;
}
- auto remove = out->mSharedWindows.erase(window);
+ auto remove = out->removeSharedWindow(window);
camera_status_t ret = (remove) ? ACAMERA_OK : ACAMERA_ERROR_INVALID_PARAMETER;
return ret;
}