Fix the problem that the data field of Entry in the verifyLogicalOrUltraHighResCameraMetadata function is empty am: 7549241c15

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

Change-Id: I102d6c279198f701576e3831983404d96a9a613e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
kongchenrui 2022-09-28 21:17:50 +00:00 committed by Automerger Merge Worker
commit 65ebae18f7
2 changed files with 11 additions and 7 deletions

View file

@ -7883,6 +7883,7 @@ void CameraHidlTest::verifyLogicalOrUltraHighResCameraMetadata(
}
}
camera_metadata_t* staticMetadata;
camera_metadata_ro_entry physicalMultiResStreamConfigs;
camera_metadata_ro_entry physicalStreamConfigs;
camera_metadata_ro_entry physicalMaxResolutionStreamConfigs;
@ -7901,8 +7902,9 @@ void CameraHidlTest::verifyLogicalOrUltraHighResCameraMetadata(
ret = subDevice->getCameraCharacteristics([&](auto status, const auto& chars) {
ASSERT_EQ(Status::OK, status);
const camera_metadata_t* staticMetadata =
reinterpret_cast<const camera_metadata_t*>(chars.data());
staticMetadata = clone_camera_metadata(
reinterpret_cast<const camera_metadata_t*>(chars.data()));
ASSERT_NE(nullptr, staticMetadata);
rc = getSystemCameraKind(staticMetadata, &physSystemCameraKind);
ASSERT_EQ(rc, Status::OK);
// Make sure that the system camera kind of a non-hidden
@ -7936,7 +7938,9 @@ void CameraHidlTest::verifyLogicalOrUltraHighResCameraMetadata(
verifyCameraCharacteristics(status, chars);
verifyMonochromeCharacteristics(chars, deviceVersion);
auto staticMetadata = (const camera_metadata_t*)chars.data();
staticMetadata = clone_camera_metadata(
reinterpret_cast<const camera_metadata_t*>(chars.data()));
ASSERT_NE(nullptr, staticMetadata);
retcode = find_camera_metadata_ro_entry(
staticMetadata, ANDROID_CONTROL_ZOOM_RATIO_RANGE, &entry);
bool subCameraHasZoomRatioRange = (0 == retcode && entry.count == 2);
@ -8064,6 +8068,7 @@ void CameraHidlTest::verifyLogicalOrUltraHighResCameraMetadata(
}
}
}
free_camera_metadata(staticMetadata);
}
// If a multi-resolution stream is supported, there must be at least one

View file

@ -1181,6 +1181,7 @@ void CameraAidlTest::verifyLogicalOrUltraHighResCameraMetadata(
camera_metadata_ro_entry physicalMultiResStreamConfigs;
camera_metadata_ro_entry physicalStreamConfigs;
camera_metadata_ro_entry physicalMaxResolutionStreamConfigs;
CameraMetadata physChars;
bool isUltraHighRes = false;
std::unordered_set<int32_t> subCameraPrivacyTestPatterns;
if (isPublicId) {
@ -1189,12 +1190,11 @@ void CameraAidlTest::verifyLogicalOrUltraHighResCameraMetadata(
ASSERT_TRUE(ret.isOk());
ASSERT_NE(subDevice, nullptr);
CameraMetadata subDeviceChars;
ret = subDevice->getCameraCharacteristics(&subDeviceChars);
ret = subDevice->getCameraCharacteristics(&physChars);
ASSERT_TRUE(ret.isOk());
const camera_metadata_t* staticMetadata =
reinterpret_cast<const camera_metadata_t*>(subDeviceChars.metadata.data());
reinterpret_cast<const camera_metadata_t*>(physChars.metadata.data());
retStatus = getSystemCameraKind(staticMetadata, &physSystemCameraKind);
ASSERT_EQ(retStatus, Status::OK);
@ -1215,7 +1215,6 @@ void CameraAidlTest::verifyLogicalOrUltraHighResCameraMetadata(
getPrivacyTestPatternModes(staticMetadata, &subCameraPrivacyTestPatterns);
} else {
// Check camera characteristics for hidden camera id
CameraMetadata physChars;
ndk::ScopedAStatus ret =
device->getPhysicalCameraCharacteristics(physicalId, &physChars);
ASSERT_TRUE(ret.isOk());