Camera3Device: Wait for empty in-flight map when waiting for idle

Currently we only wait for the request queue to be idle, and for
all outstanding buffers to be returned to their queues and their
fences triggered.

But we also need to wait for result metadata to arrive for all
in-flight requests.  This is simplest to check for by monitoring
entries in the in-flight map and signaling idle/active to the
status tracker when the map becomes empty/nonempty.

Bug: 30282459
Change-Id: I34275b0fdb4f279783291d300707ac21a6aa5249
diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h
index bbb6563..ea5a4b3 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.h
+++ b/services/camera/libcameraservice/device3/Camera3Device.h
@@ -727,6 +727,7 @@
 
     Mutex                  mInFlightLock; // Protects mInFlightMap
     InFlightMap            mInFlightMap;
+    int                    mInFlightStatusId;
 
     status_t registerInFlight(uint32_t frameNumber,
             int32_t numBuffers, CaptureResultExtras resultExtras, bool hasInput,