From 78eaf011ce64256b57c16bea916bf0f7b03815cc Mon Sep 17 00:00:00 2001 From: chen0088 Date: Mon, 26 Sep 2022 14:52:40 +0800 Subject: [PATCH] fix: upload local camera Signed-off-by: chen0088 --- .../handler/src/dcamera_handler.cpp | 22 +++++++------------ .../handler/src/dcamera_handler_common.cpp | 22 +++++++------------ 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp b/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp index cd335571..3f647dc3 100644 --- a/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp +++ b/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp @@ -64,13 +64,10 @@ std::vector DCameraHandler::Query() DHLOGI("DCameraHandler::Query connection type: %d", info->GetConnectionType()); continue; } - if ((info->GetPosition() == OHOS_CAMERA_POSITION_OTHER) || - (info->GetPosition() == OHOS_CAMERA_POSITION_FRONT) || - (info->GetPosition() == OHOS_CAMERA_POSITION_BACK && - info->GetCameraType() == OHOS_CAMERA_TYPE_LOGICAL)) { - DHItem item = CreateDHItem(info); - itemList.emplace_back(item); - } + DHLOGI("DCameraHandler::Query get %s, position: %d, cameraType: %d", + GetAnonyString(info->GetID()).c_str(), info->GetPosition(), info->GetCameraType()); + DHItem item = CreateDHItem(info); + itemList.emplace_back(item); } DHLOGI("DCameraHandler::Query success, get %d items", itemList.size()); return itemList; @@ -118,13 +115,10 @@ std::vector DCameraHandler::GetCameras() DHLOGI("DCameraHandler::GetCameras connection type: %d", info->GetConnectionType()); continue; } - if ((info->GetPosition() == OHOS_CAMERA_POSITION_OTHER) || - (info->GetPosition() == OHOS_CAMERA_POSITION_FRONT) || - (info->GetPosition() == OHOS_CAMERA_POSITION_BACK && - info->GetCameraType() == OHOS_CAMERA_TYPE_LOGICAL)) { - std::string dhId = CAMERA_ID_PREFIX + info->GetID(); - cameras.emplace_back(dhId); - } + DHLOGI("DCameraHandler::GetCameras get %s, position: %d, cameraType: %d", + GetAnonyString(info->GetID()).c_str(), info->GetPosition(), info->GetCameraType()); + std::string dhId = CAMERA_ID_PREFIX + info->GetID(); + cameras.emplace_back(dhId); } DHLOGI("DCameraHandler::GetCameras success, get %d items", cameras.size()); return cameras; diff --git a/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp b/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp index 414fc97c..572c5eb9 100644 --- a/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp +++ b/services/cameraservice/cameraoperator/handler/src/dcamera_handler_common.cpp @@ -64,13 +64,10 @@ std::vector DCameraHandler::Query() DHLOGI("DCameraHandlerCommon::Query connection type: %d", info->GetConnectionType()); continue; } - if ((info->GetPosition() == OHOS_CAMERA_POSITION_OTHER) || - (info->GetPosition() == OHOS_CAMERA_POSITION_FRONT) || - (info->GetPosition() == OHOS_CAMERA_POSITION_BACK && - info->GetCameraType() == OHOS_CAMERA_TYPE_LOGICAL)) { - DHItem item = CreateDHItem(info); - itemList.emplace_back(item); - } + DHLOGI("DCameraHandlerCommon::Query get %s, position: %d, cameraType: %d", + GetAnonyString(info->GetID()).c_str(), info->GetPosition(), info->GetCameraType()); + DHItem item = CreateDHItem(info); + itemList.emplace_back(item); } DHLOGI("DCameraHandlerCommon::Query success, get %d items", itemList.size()); return itemList; @@ -118,13 +115,10 @@ std::vector DCameraHandler::GetCameras() DHLOGI("DCameraHandlerCommon::GetCameras connection type: %d", info->GetConnectionType()); continue; } - if ((info->GetPosition() == OHOS_CAMERA_POSITION_OTHER) || - (info->GetPosition() == OHOS_CAMERA_POSITION_FRONT) || - (info->GetPosition() == OHOS_CAMERA_POSITION_BACK && - info->GetCameraType() == OHOS_CAMERA_TYPE_LOGICAL)) { - std::string dhId = CAMERA_ID_PREFIX + info->GetID(); - cameras.emplace_back(dhId); - } + DHLOGI("DCameraHandlerCommon::GetCameras get %s, position: %d, cameraType: %d", + GetAnonyString(info->GetID()).c_str(), info->GetPosition(), info->GetCameraType()); + std::string dhId = CAMERA_ID_PREFIX + info->GetID(); + cameras.emplace_back(dhId); } DHLOGI("DCameraHandlerCommon::GetCameras success, get %d items", cameras.size()); return cameras; -- Gitee