composer: make PresentOrValidate.Result consistent with hidl
HIDL expects that Presented will be 1 and Validated witll be 0.
Even though we map the enum values of PresentOrValidate.Result
to the correct value, this CL makes the interface consistent with
the HIDL so that we can directly use the enum value.
Bug: 208856704
Test: VTS
Change-Id: I9fb2421e32c2288c5495422eda6764f6102337f0
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
index 3514e53..e6ddeba 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
@@ -38,7 +38,7 @@
android.hardware.graphics.composer3.PresentOrValidate.Result result;
@VintfStability
enum Result {
- Presented = 0,
- Validated = 1,
+ Validated = 0,
+ Presented = 1,
}
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
index f3153bd..5ae8940 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
@@ -27,6 +27,6 @@
/**
* Whether PresentOrValidate presented or validated the display.
*/
- @VintfStability enum Result { Presented, Validated }
+ @VintfStability enum Result { Validated, Presented }
Result result;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
index 8a789e3..c1e988a 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
@@ -327,6 +327,13 @@
static_cast<aidl::android::hardware::graphics::composer3::ContentType>(
::android::hardware::graphics::composer::V2_4::IComposerClient::ContentType::GAME));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PresentOrValidate::Result::Presented ==
+ static_cast<aidl::android::hardware::graphics::composer3::PresentOrValidate::Result>(1));
+static_assert(
+ aidl::android::hardware::graphics::composer3::PresentOrValidate::Result::Validated ==
+ static_cast<aidl::android::hardware::graphics::composer3::PresentOrValidate::Result>(0));
+
__attribute__((warn_unused_result)) bool translate(
const ::android::hardware::graphics::composer::V2_4::VsyncPeriodChangeTimeline& in,
aidl::android::hardware::graphics::composer3::VsyncPeriodChangeTimeline* out) {