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

Commit 326f9b5c authored by Austin Borger's avatar Austin Borger Committed by Android (Google) Code Review
Browse files

Merge "CameraDeviceImpl: Follow through reporting device errors even if the...

Merge "CameraDeviceImpl: Follow through reporting device errors even if the remote device was never initialized."
parents fa377e7d 2a95ec27
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public class CameraDeviceImpl extends CameraDevice

    // TODO: guard every function with if (!mRemoteDevice) check (if it was closed)
    private ICameraDeviceUserWrapper mRemoteDevice;
    private boolean mRemoteDeviceInit = false;

    // Lock to synchronize cross-thread access to device public interface
    final Object mInterfaceLock = new Object(); // access from this class and Session only!
@@ -336,6 +337,8 @@ public class CameraDeviceImpl extends CameraDevice

            mDeviceExecutor.execute(mCallOnOpened);
            mDeviceExecutor.execute(mCallOnUnconfigured);

            mRemoteDeviceInit = true;
        }
    }

@@ -1752,8 +1755,8 @@ public class CameraDeviceImpl extends CameraDevice
        }

        synchronized(mInterfaceLock) {
            if (mRemoteDevice == null) {
                return; // Camera already closed
            if (mRemoteDevice == null && mRemoteDeviceInit) {
                return; // Camera already closed, user is not interested in errors anymore.
            }

            // Redirect device callback to the offline session in case we are in the middle