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

Commit 92521a31 authored by Ravneet Dhanjal's avatar Ravneet Dhanjal
Browse files

Camera: Avoid permission check if fallback impl is not enabled

- In connectToProxyLocked, for the case when the vendor proxy service
is supported and the fallback is not, the vendor proxy service will
remain connected to during the check for the fallback impl (or when
useFallback is true, triggered if the vendor impl does not support an
extension). In this case, the permission check should be avoided when
returning to registerClientHelper.

Test: Camera CTS on lynx where vendor proxy is supported and fallback is not; CTS on CF
Bug: 346632129
Change-Id: I826040f582e61339a0df139dc9ce514631af0a6a
parent 7843b7c4
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -280,6 +280,7 @@ public final class CameraExtensionCharacteristics {
        private final int PROXY_SERVICE_DELAY_MS = 2000;
        private final int PROXY_SERVICE_DELAY_MS = 2000;
        private ExtensionConnectionManager mConnectionManager = new ExtensionConnectionManager();
        private ExtensionConnectionManager mConnectionManager = new ExtensionConnectionManager();
        private boolean mPermissionForFallbackEnabled = false;
        private boolean mPermissionForFallbackEnabled = false;
        private boolean mIsFallbackEnabled = false;


        // Singleton, don't allow construction
        // Singleton, don't allow construction
        private CameraExtensionManagerGlobal() {}
        private CameraExtensionManagerGlobal() {}
@@ -327,6 +328,7 @@ public final class CameraExtensionCharacteristics {
                                "Choosing the fallback software implementation service: "
                                "Choosing the fallback software implementation service: "
                                + serviceName);
                                + serviceName);
                        intent.setClassName(packageName, serviceName);
                        intent.setClassName(packageName, serviceName);
                        mIsFallbackEnabled = true;
                    }
                    }
                }
                }


@@ -438,7 +440,7 @@ public final class CameraExtensionCharacteristics {
                    releaseProxyConnectionLocked(ctx, extension);
                    releaseProxyConnectionLocked(ctx, extension);
                }
                }


                if (Flags.concertMode() && ret && useFallback) {
                if (Flags.concertMode() && ret && useFallback && mIsFallbackEnabled) {
                    try {
                    try {
                        InitializeSessionHandler cb = new InitializeSessionHandler(ctx);
                        InitializeSessionHandler cb = new InitializeSessionHandler(ctx);
                        initializeSession(cb, extension);
                        initializeSession(cb, extension);