Introduce hidl_bitfield.
This is an alias for the underlying type of the enum and
provides more type information than the underlying type alone.
Bug: 70979815
Test: all hidl-gen host tests
Change-Id: Ib9ff14c0ec1c9e50fa1952fb76eb8cfbaea1316a
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 5cda20a..f09eb63 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -990,6 +990,12 @@
template <typename>
struct hidl_enum_iterator;
+/**
+ * Bitfields in HIDL are the underlying type of the enumeration.
+ */
+template <typename Enum>
+using hidl_bitfield = typename std::underlying_type<Enum>::type;
+
} // namespace hardware
} // namespace android