From efb7bfa9934a25ece6844aadbcb6df7a9aa5625a Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Wed, 15 Mar 2017 18:26:39 -0700 Subject: [PATCH] Camera: Provider: Set up vendor tag before getDeviceVersion getDeviceVersion calls get_camera_info, which could contain vendor tags. As a result, we need to set up vendor tag before that. Test: Verify vendor tag in static metadata works. Bug: 33641150 Change-Id: Id4cfea52235542b19170a757b4c6bea3ad1d190d --- camera/provider/2.4/default/CameraProvider.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/camera/provider/2.4/default/CameraProvider.cpp b/camera/provider/2.4/default/CameraProvider.cpp index ad9f0b8621..8701ec1db7 100644 --- a/camera/provider/2.4/default/CameraProvider.cpp +++ b/camera/provider/2.4/default/CameraProvider.cpp @@ -183,6 +183,12 @@ bool CameraProvider::initialize() { } ALOGI("Loaded \"%s\" camera module", mModule->getModuleName()); + // Setup vendor tags here so HAL can setup vendor keys in camera characteristics + VendorTagDescriptor::clearGlobalVendorTagDescriptor(); + if (!setUpVendorTags()) { + ALOGE("%s: Vendor tag setup failed, will not be available.", __FUNCTION__); + } + // Setup callback now because we are going to try openLegacy next err = mModule->setCallbacks(this); if (err != OK) { @@ -225,11 +231,6 @@ bool CameraProvider::initialize() { } } - // Setup vendor tags here so HAL can setup vendor keys in camera characteristics - VendorTagDescriptor::clearGlobalVendorTagDescriptor(); - if (!setUpVendorTags()) { - ALOGE("%s: Vendor tag setup failed, will not be available.", __FUNCTION__); - } return false; // mInitFailed }