diff options
| author | 2023-01-11 22:03:57 +0000 | |
|---|---|---|
| committer | 2023-01-11 22:03:57 +0000 | |
| commit | 585a299c9ac6c7da68683d41a04eba06fbd377da (patch) | |
| tree | 90bcbcec0c3ccd1f1192fe705354f1d14e816bfd | |
| parent | 0c4715aa332db860f188f9b841851bfbf688cddf (diff) | |
| parent | 52c79d4b4f00cc1adbb29949ebe7ac978fce6002 (diff) | |
Merge "CameraDeviceImpl: Follow through reporting device errors even if the remote device was never initialized." into tm-qpr-dev
| -rw-r--r-- | core/java/android/hardware/camera2/impl/CameraDeviceImpl.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java index a6c79b3a289f..0c2468e65577 100644 --- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java @@ -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 |