drm_hwcomposer: Use __ANDROID_API__ instead of PLATFORM_SDK_VERSION
__ANDROID_API__ definition is available by default in AOSP and NDK.
It also exported by standard system clang when the user sets
the '-target <ARCH>-linux-android<LEVEL>' compiler flag.
Reason for this change is integration of meson build script, where
otherwise the user has to provide the API level manually.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index cfef776..115b61a 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -322,7 +322,7 @@
kUmPerInch / mm_height)
: -1;
break;
-#if PLATFORM_SDK_VERSION > 29
+#if __ANDROID_API__ > 29
case HWC2::Attribute::ConfigGroup:
/* Dispite ConfigGroup is a part of HWC2.4 API, framework
* able to request it even if service @2.1 is used */
@@ -772,7 +772,7 @@
(int32_t *)(outVsyncPeriod));
}
-#if PLATFORM_SDK_VERSION > 29
+#if __ANDROID_API__ > 29
HWC2::Error HwcDisplay::GetDisplayConnectionType(uint32_t *outType) {
if (IsInHeadlessMode()) {
*outType = static_cast<uint32_t>(HWC2::DisplayConnectionType::Internal);
@@ -850,7 +850,7 @@
}
#endif
-#if PLATFORM_SDK_VERSION > 28
+#if __ANDROID_API__ > 28
HWC2::Error HwcDisplay::GetDisplayIdentificationData(uint8_t *outPort,
uint32_t *outDataSize,
uint8_t *outData) {
@@ -895,9 +895,9 @@
return HWC2::Error::Unsupported;
}
-#endif /* PLATFORM_SDK_VERSION > 28 */
+#endif /* __ANDROID_API__ > 28 */
-#if PLATFORM_SDK_VERSION > 27
+#if __ANDROID_API__ > 27
HWC2::Error HwcDisplay::GetRenderIntents(
int32_t mode, uint32_t *outNumIntents,
@@ -933,7 +933,7 @@
return HWC2::Error::None;
}
-#endif /* PLATFORM_SDK_VERSION > 27 */
+#endif /* __ANDROID_API__ > 27 */
const Backend *HwcDisplay::backend() const {
return backend_.get();