drm_hwcomposer: Support multiple AIDL versions
As far as I know, there's no way for Soong to support multiple versions
that will change dependencies based on the Android API version.
However, we can still do that if we build with the aospext project,
making it possible for Android-13 and Android-14 to use the latest
drm_hwcomposer.
Change-Id: Ifeee42d3af64ff873b1a149231dc542ee2aee1df
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/hwc3/DrmHwcThree.cpp b/hwc3/DrmHwcThree.cpp
index 2ac307c..fb14bc9 100644
--- a/hwc3/DrmHwcThree.cpp
+++ b/hwc3/DrmHwcThree.cpp
@@ -22,7 +22,9 @@
#include "Utils.h"
#include "aidl/android/hardware/graphics/common/Dataspace.h"
+#if __ANDROID_API__ >= 35
#include "aidl/android/hardware/graphics/common/DisplayHotplugEvent.h"
+#endif
namespace aidl::android::hardware::graphics::composer3::impl {
@@ -61,6 +63,8 @@
static_cast<int32_t>(vsync_period));
}
+#if __ANDROID_API__ >= 35
+
void DrmHwcThree::SendHotplugEventToClient(
hwc2_display_t display_id, DrmHwc::DisplayStatus display_status) {
common::DisplayHotplugEvent event = common::DisplayHotplugEvent::DISCONNECTED;
@@ -80,6 +84,17 @@
composer_callback_->onHotplugEvent(static_cast<int64_t>(display_id), event);
}
+#else
+
+void DrmHwcThree::SendHotplugEventToClient(
+ hwc2_display_t display_id, DrmHwc::DisplayStatus display_status) {
+ bool connected = display_status != DrmHwc::kDisconnected;
+ HandleDisplayHotplugEvent(static_cast<uint64_t>(display_id), connected);
+ composer_callback_->onHotplug(static_cast<int64_t>(display_id), connected);
+}
+
+#endif
+
void DrmHwcThree::CleanDisplayResources(uint64_t display_id) {
DEBUG_FUNC();
HwcDisplay* display = GetDisplay(display_id);