summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichelle Ho <himichelle@google.com>2023-05-25 10:57:21 +0000
committerMichelle Ho <himichelle@google.com>2023-05-26 09:35:16 +0000
commit098a0ef0e9e9ed875a7afe07ee25b19b5011a8af (patch)
treee3ebef4bf689edce575673fcf4e64ca68d2b216e
parent95650077018fd46ee3815749fc8c900945c2a77a (diff)
downloadcamera-098a0ef0e9e9ed875a7afe07ee25b19b5011a8af.tar.gz
Add max device state enum for validation
Device state is a bit field data, and we need to define a max value for data validation. Bug: 284098431 Test: build pass, basic functionality tests Change-Id: I54e97d087b6b899d87a75d4fb2841c5d52f5801c Merged-In: I54e97d087b6b899d87a75d4fb2841c5d52f5801c
-rw-r--r--common/hal/common/hal_types.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/hal/common/hal_types.h b/common/hal/common/hal_types.h
index 0f7f9da..8695418 100644
--- a/common/hal/common/hal_types.h
+++ b/common/hal/common/hal_types.h
@@ -386,9 +386,10 @@ struct BufferReturn {
// ::android::hardware::camera::provider::V2_5::DeviceState
enum class DeviceState : uint64_t {
kNormal = 0ull,
- kBackCovered = 1ull,
- kFrontCovered = 2ull,
- kFolded = 4ull
+ kBackCovered = 1 << 0,
+ kFrontCovered = 1 << 1,
+ kFolded = 1 << 2,
+ kMaxDeviceState = 1 << 3 // for data validation
};
// Callback function invoked to process capture results.