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

Commit a5af4bde authored by Austin Borger's avatar Austin Borger Committed by Automerger Merge Worker
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." into tm-qpr-dev am: 585a299c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20922063



Change-Id: Ib30424d4024af894ce321dad26ebd91e621c589a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 38dbc64b 585a299c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -87,6 +87,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!
@@ -338,6 +339,8 @@ public class CameraDeviceImpl extends CameraDevice

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

            mRemoteDeviceInit = true;
        }
    }

@@ -1754,8 +1757,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