mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Camera: add proper HwLevel check
am: cd02298b46
Change-Id: I30593eda48d5ba1cca0e5e29f4bc99f27351da23
This commit is contained in:
@@ -2067,6 +2067,19 @@ TEST_F(CameraHidlTest, getCameraCharacteristics) {
|
||||
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