Check if device is already idle, and if so, don't actually flush,
just fire the busy/idle callbacks to the session.
Bug:
17306157
Change-Id: I7ba416c6014c7bc1edcad07910aa0aff232af8b0
checkIfCameraClosedOrInError();
mDeviceHandler.post(mCallOnBusy);
+
+ // If already idle, just do a busy->idle transition immediately, don't actually
+ // flush.
+ if (mIdle) {
+ mDeviceHandler.post(mCallOnIdle);
+ return;
+ }
try {
LongParcelable lastFrameNumberRef = new LongParcelable();
mRemoteDevice.flush(/*out*/lastFrameNumberRef);