CameraManager: Add path to update vendorTag info upon HAL update

- Add setupVendorTag to onStatusChanged callback to update
vendor tag information upon status changes in case HAL does
not load the vendorTag information during connect

Bug: 181579423
Test: Manual; GCA Validity check; Removed setUpVendorTag in enumerateProviders to force initial vendorTag info update using
onStatusChanged

Change-Id: I8d8c00159d49a13a7b5bbc9b26a2b474fc99aee4
This commit is contained in:
Ravneet
2022-05-03 02:30:20 +00:00
committed by Ravneet Dhanjal
parent fe138c84ea
commit ffaa2a236b
2 changed files with 16 additions and 1 deletions

View File

@@ -2200,6 +2200,14 @@ public final class CameraManager {
return;
}
// Setup vendor tag on status change in case it was not set correctly
// during connect due to issues in HAL
try {
CameraMetadataNative.setupGlobalVendorTagDescriptor();
} catch (ServiceSpecificException e) {
handleRecoverableSetupErrors(e);
}
Integer oldStatus;
if (status == ICameraServiceListener.STATUS_NOT_PRESENT) {
oldStatus = mDeviceStatus.remove(id);

View File

@@ -947,8 +947,15 @@ static jint CameraMetadata_setupGlobalVendorTagDescriptor(JNIEnv *env, jclass th
return hardware::ICameraService::ERROR_DISCONNECTED;
}
binder::Status res = cameraService->setUpVendorTags();
if (!res.isOk()) {
ALOGE("%s: Failed to setup vendor tags for camera providers: %s", __FUNCTION__,
res.toString8().string());
return res.serviceSpecificErrorCode();
}
sp<VendorTagDescriptor> desc = new VendorTagDescriptor();
binder::Status res = cameraService->getCameraVendorTagDescriptor(/*out*/desc.get());
res = cameraService->getCameraVendorTagDescriptor(/*out*/ desc.get());
if (res.serviceSpecificErrorCode() == hardware::ICameraService::ERROR_DISCONNECTED) {
// No camera module available, not an error on devices with no cameras