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

Commit 077aeed1 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5892339 from a1181053 to qt-qpr1-release

Change-Id: I61542aaf83754590c3def27bd2863535b6b21f6e
parents 15c913de a1181053
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ int main(int argc __unused, char** argv __unused)
    sp<IServiceManager> sm = defaultServiceManager();
    ALOGI("ServiceManager: %p", sm.get());
    CameraService::instantiate();
    ALOGI("ServiceManager: %p done instantiate", sm.get());
    ProcessState::self()->startThreadPool();
    IPCThreadState::self()->joinThreadPool();
}
+4 −0
Original line number Diff line number Diff line
@@ -547,6 +547,10 @@ TEST_P(Codec2AudioDecDecodeTest, DecodeTest) {
    if (mCompName == raw) {
        bitStreamInfo[0] = 8000;
        bitStreamInfo[1] = 1;
    } else if (mCompName == g711alaw || mCompName == g711mlaw) {
        // g711 test data is all 1-channel and has no embedded config info.
        bitStreamInfo[0] = 8000;
        bitStreamInfo[1] = 1;
    } else {
        ASSERT_NO_FATAL_FAILURE(
            getInputChannelInfo(mComponent, mCompName, bitStreamInfo));
+5 −2
Original line number Diff line number Diff line
@@ -153,8 +153,6 @@ void CameraService::onFirstRef()
        mInitialized = true;
    }

    CameraService::pingCameraServiceProxy();

    mUidPolicy = new UidPolicy(this);
    mUidPolicy->registerSelf();
    mSensorPrivacyPolicy = new SensorPrivacyPolicy(this);
@@ -164,6 +162,11 @@ void CameraService::onFirstRef()
        ALOGE("%s: Failed to register default android.frameworks.cameraservice.service@1.0",
              __FUNCTION__);
    }

    // This needs to be last call in this function, so that it's as close to
    // ServiceManager::addService() as possible.
    CameraService::pingCameraServiceProxy();
    ALOGI("CameraService pinged cameraservice proxy");
}

status_t CameraService::enumerateProviders() {
+16 −3
Original line number Diff line number Diff line
@@ -108,7 +108,13 @@ int CameraProviderManager::getCameraCount() const {
    std::lock_guard<std::mutex> lock(mInterfaceMutex);
    int count = 0;
    for (auto& provider : mProviders) {
        count += provider->mUniqueCameraIds.size();
        for (auto& id : provider->mUniqueCameraIds) {
            // Hidden secure camera ids are not to be exposed to camera1 api.
            if (isPublicallyHiddenSecureCameraLocked(id)) {
                continue;
            }
            count++;
        }
    }
    return count;
}
@@ -134,7 +140,11 @@ std::vector<std::string> CameraProviderManager::getAPI1CompatibleCameraDeviceIds
        // for each camera facing, only take the first id advertised by HAL in
        // all [logical, physical1, physical2, ...] id combos, and filter out the rest.
        filterLogicalCameraIdsLocked(providerDeviceIds);

        // Hidden secure camera ids are not to be exposed to camera1 api.
        providerDeviceIds.erase(std::remove_if(providerDeviceIds.begin(), providerDeviceIds.end(),
                [this](const std::string& s) {
                    return this->isPublicallyHiddenSecureCameraLocked(s);}),
                providerDeviceIds.end());
        deviceIds.insert(deviceIds.end(), providerDeviceIds.begin(), providerDeviceIds.end());
    }

@@ -1046,9 +1056,12 @@ bool CameraProviderManager::isLogicalCamera(const std::string& id,
    return deviceInfo->mIsLogicalCamera;
}

bool CameraProviderManager::isPublicallyHiddenSecureCamera(const std::string& id) {
bool CameraProviderManager::isPublicallyHiddenSecureCamera(const std::string& id) const {
    std::lock_guard<std::mutex> lock(mInterfaceMutex);
    return isPublicallyHiddenSecureCameraLocked(id);
}

bool CameraProviderManager::isPublicallyHiddenSecureCameraLocked(const std::string& id) const {
    auto deviceInfo = findDeviceInfoLocked(id);
    if (deviceInfo == nullptr) {
        return false;
+4 −1
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ public:
     */
    bool isLogicalCamera(const std::string& id, std::vector<std::string>* physicalCameraIds);

    bool isPublicallyHiddenSecureCamera(const std::string& id);
    bool isPublicallyHiddenSecureCamera(const std::string& id) const;
    bool isHiddenPhysicalCamera(const std::string& cameraId);

    static const float kDepthARTolerance;
@@ -594,6 +594,9 @@ private:

    status_t getCameraCharacteristicsLocked(const std::string &id,
            CameraMetadata* characteristics) const;

    bool isPublicallyHiddenSecureCameraLocked(const std::string& id) const;

    void filterLogicalCameraIdsLocked(std::vector<std::string>& deviceIds) const;
};