mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Camera: add hardware level check"
This commit is contained in:
committed by
Android (Google) Code Review
commit
5ccd0eb248
@@ -1905,6 +1905,19 @@ TEST_F(CameraHidlTest, getCameraCharacteristics) {
|
||||
// characteristics keys we've defined.
|
||||
ASSERT_GT(entryCount, 0u);
|
||||
ALOGI("getCameraCharacteristics metadata entry count is %zu", entryCount);
|
||||
|
||||
camera_metadata_ro_entry entry;
|
||||
int retcode = find_camera_metadata_ro_entry(metadata,
|
||||
ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, &entry);
|
||||
if ((0 == retcode) && (entry.count > 0)) {
|
||||
uint8_t hardwareLevel = entry.data.u8[0];
|
||||
ASSERT_TRUE(
|
||||
hardwareLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED ||
|
||||
hardwareLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL ||
|
||||
hardwareLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3);
|
||||
} else {
|
||||
ADD_FAILURE() << "Get camera hardware level failed!";
|
||||
}
|
||||
});
|
||||
ASSERT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user