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

Commit e5941c17 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7563534 from 502d3db0 to sc-release

Change-Id: I7d98c49eb76c97a8c40ad94586290d32c340d543
parents 1e8c4ec9 502d3db0
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -240,7 +240,13 @@ status_t CameraService::enumerateProviders() {
    // Derive primary rear/front cameras, and filter their charactierstics.
    // Derive primary rear/front cameras, and filter their charactierstics.
    // This needs to be done after all cameras are enumerated and camera ids are sorted.
    // This needs to be done after all cameras are enumerated and camera ids are sorted.
    if (SessionConfigurationUtils::IS_PERF_CLASS) {
    if (SessionConfigurationUtils::IS_PERF_CLASS) {
        filterSPerfClassCharacteristics();
        // Assume internal cameras are advertised from the same
        // provider. If multiple providers are registered at different time,
        // and each provider contains multiple internal color cameras, the current
        // logic may filter the characteristics of more than one front/rear color
        // cameras.
        Mutex::Autolock l(mServiceLock);
        filterSPerfClassCharacteristicsLocked();
    }
    }


    return OK;
    return OK;
@@ -313,7 +319,7 @@ void CameraService::updateCameraNumAndIds() {
    filterAPI1SystemCameraLocked(mNormalDeviceIds);
    filterAPI1SystemCameraLocked(mNormalDeviceIds);
}
}


void CameraService::filterSPerfClassCharacteristics() {
void CameraService::filterSPerfClassCharacteristicsLocked() {
    // To claim to be S Performance primary cameras, the cameras must be
    // To claim to be S Performance primary cameras, the cameras must be
    // backward compatible. So performance class primary camera Ids must be API1
    // backward compatible. So performance class primary camera Ids must be API1
    // compatible.
    // compatible.
+3 −2
Original line number Original line Diff line number Diff line
@@ -945,9 +945,10 @@ private:
    void updateCameraNumAndIds();
    void updateCameraNumAndIds();


    /**
    /**
     * Filter camera characteristics for S Performance class primary cameras
     * Filter camera characteristics for S Performance class primary cameras.
     * mServiceLock should be locked.
     */
     */
    void filterSPerfClassCharacteristics();
    void filterSPerfClassCharacteristicsLocked();


    // File descriptor to temp file used for caching previous open
    // File descriptor to temp file used for caching previous open
    // session dumpsys info.
    // session dumpsys info.
+3 −2
Original line number Original line Diff line number Diff line
@@ -476,15 +476,16 @@ hardware::Return<void> CameraProviderManager::onRegistration(
        const hardware::hidl_string& /*fqName*/,
        const hardware::hidl_string& /*fqName*/,
        const hardware::hidl_string& name,
        const hardware::hidl_string& name,
        bool preexisting) {
        bool preexisting) {
    status_t res = OK;
    std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock);
    std::lock_guard<std::mutex> providerLock(mProviderLifecycleLock);
    {
    {
        std::lock_guard<std::mutex> lock(mInterfaceMutex);
        std::lock_guard<std::mutex> lock(mInterfaceMutex);


        addProviderLocked(name, preexisting);
        res = addProviderLocked(name, preexisting);
    }
    }


    sp<StatusListener> listener = getStatusListener();
    sp<StatusListener> listener = getStatusListener();
    if (nullptr != listener.get()) {
    if (nullptr != listener.get() && res == OK) {
        listener->onNewProviderRegistered();
        listener->onNewProviderRegistered();
    }
    }