Merge "Cast to the underlying type for union tags" am: 6cd0d474b2 am: 5eb895c047 am: bbd66d27a0

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1999055

Change-Id: Ie0a38cc29d50c65b8168435c70786321fc9de199