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

Commit b7cd2779 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libbinder_rs: Add enum_values function to AIDL enums" am: 81d10e64 am: 41413126

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1751821

Change-Id: Ie70d15a26ebc8823605f4ae7112ae29e80230515
parents f3d34a71 41413126
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -897,7 +897,7 @@ macro_rules! declare_binder_interface {
#[macro_export]
macro_rules! declare_binder_enum {
    {
        $enum:ident : $backing:ty {
        $enum:ident : [$backing:ty; $size:expr] {
            $( $name:ident = $value:expr, )*
        }
    } => {
@@ -905,6 +905,11 @@ macro_rules! declare_binder_enum {
        pub struct $enum(pub $backing);
        impl $enum {
            $( pub const $name: Self = Self($value); )*

            #[inline(always)]
            pub const fn enum_values() -> [Self; $size] {
                [$(Self::$name),*]
            }
        }

        impl $crate::parcel::Serialize for $enum {