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/ComposerClient.cpp b/hwc3/ComposerClient.cpp
index 2aed2bc..0597712 100644
--- a/hwc3/ComposerClient.cpp
+++ b/hwc3/ComposerClient.cpp
@@ -190,6 +190,28 @@
}
}
+#if __ANDROID_API__ < 35
+
+class DisplayConfiguration {
+ public:
+ class Dpi {
+ public:
+ float x = 0.000000F;
+ float y = 0.000000F;
+ };
+ // NOLINTNEXTLINE(readability-identifier-naming)
+ int32_t configId = 0;
+ int32_t width = 0;
+ int32_t height = 0;
+ std::optional<Dpi> dpi;
+ // NOLINTNEXTLINE(readability-identifier-naming)
+ int32_t configGroup = 0;
+ // NOLINTNEXTLINE(readability-identifier-naming)
+ int32_t vsyncPeriod = 0;
+};
+
+#endif
+
DisplayConfiguration HwcDisplayConfigToAidlConfiguration(
const HwcDisplayConfigs& configs, const HwcDisplayConfig& config) {
DisplayConfiguration aidl_configuration =
@@ -1173,6 +1195,8 @@
return ToBinderStatus(hwc3::Error::kUnsupported);
}
+#if __ANDROID_API__ >= 35
+
ndk::ScopedAStatus ComposerClient::getDisplayConfigurations(
int64_t display_id, int32_t /*max_frame_interval_ns*/,
std::vector<DisplayConfiguration>* configurations) {
@@ -1197,6 +1221,8 @@
return ToBinderStatus(hwc3::Error::kUnsupported);
}
+#endif
+
std::string ComposerClient::Dump() {
uint32_t size = 0;
hwc_->Dump(&size, nullptr);