Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9b5df3c authored by Ady Abraham's avatar Ady Abraham
Browse files

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
parent 3b417508
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ parcelable PresentOrValidate {
  android.hardware.graphics.composer3.PresentOrValidate.Result result;
  @VintfStability
  enum Result {
    Presented = 0,
    Validated = 1,
    Validated = 0,
    Presented = 1,
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -27,6 +27,6 @@ parcelable PresentOrValidate {
    /**
     * Whether PresentOrValidate presented or validated the display.
     */
    @VintfStability enum Result { Presented, Validated }
    @VintfStability enum Result { Validated, Presented }
    Result result;
}
+7 −0
Original line number Diff line number Diff line
@@ -327,6 +327,13 @@ static_assert(
        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) {