Merge "CameraDeviceImpl: Follow through reporting device errors even if the remote device was never initialized." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
585a299c9a
@@ -87,6 +87,7 @@ public class CameraDeviceImpl extends CameraDevice
|
|||||||
|
|
||||||
// TODO: guard every function with if (!mRemoteDevice) check (if it was closed)
|
// TODO: guard every function with if (!mRemoteDevice) check (if it was closed)
|
||||||
private ICameraDeviceUserWrapper mRemoteDevice;
|
private ICameraDeviceUserWrapper mRemoteDevice;
|
||||||
|
private boolean mRemoteDeviceInit = false;
|
||||||
|
|
||||||
// Lock to synchronize cross-thread access to device public interface
|
// Lock to synchronize cross-thread access to device public interface
|
||||||
final Object mInterfaceLock = new Object(); // access from this class and Session only!
|
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(mCallOnOpened);
|
||||||
mDeviceExecutor.execute(mCallOnUnconfigured);
|
mDeviceExecutor.execute(mCallOnUnconfigured);
|
||||||
|
|
||||||
|
mRemoteDeviceInit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1754,8 +1757,8 @@ public class CameraDeviceImpl extends CameraDevice
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized(mInterfaceLock) {
|
synchronized(mInterfaceLock) {
|
||||||
if (mRemoteDevice == null) {
|
if (mRemoteDevice == null && mRemoteDeviceInit) {
|
||||||
return; // Camera already closed
|
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
|
// Redirect device callback to the offline session in case we are in the middle
|
||||||
|
|||||||
Reference in New Issue
Block a user