Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1c48eda authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Support all API1 compatible camera devices

API1 compatible camera devices shouldn't be filtered based on
their provider type. Devices must advertise their support by
enabling the backward compatiblity flag in their static camera
capabilities.

Bug: 73738052
Test: Camera CTS
Change-Id: I2b3d80051e89b3a8908d636a1156a32e89b7c4f1
parent 16ac9b68
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -39,9 +39,6 @@ namespace {
const std::string kLegacyProviderName("legacy/0");
const std::string kExternalProviderName("external/0");

// Slash-separated list of provider types to consider for use via the old camera API
const std::string kStandardProviderTypes("internal/legacy/external");

} // anonymous namespace

CameraProviderManager::HardwareServiceInteractionProxy
@@ -101,12 +98,10 @@ std::vector<std::string> CameraProviderManager::getAPI1CompatibleCameraDeviceIds
    std::lock_guard<std::mutex> lock(mInterfaceMutex);
    std::vector<std::string> deviceIds;
    for (auto& provider : mProviders) {
        if (kStandardProviderTypes.find(provider->getType()) != std::string::npos) {
        for (auto& id : provider->mUniqueAPI1CompatibleCameraIds) {
            deviceIds.push_back(id);
        }
    }
    }

    std::sort(deviceIds.begin(), deviceIds.end(),
            [](const std::string& a, const std::string& b) -> bool {