Fix few issues in virtual camera service:

  * Fix incorrect flush implementation (do not try to fetch element from
    empty queue).
  * Gracefully handle flush call even if render thread is not running.
  * Make sure thread is terminated when close is called on session.
  * Remove metadata from CaptureResult send when processing flush
    request.
  * Set streamId to -1 in ErrorRequest NotifyMsg (required, otherwise
    it NotifyMsg fails validation in framework).

Bug: 301023410
Test: atest virtual_camera_tests
Test: OpenCamera
Change-Id: I899a9eaed0b69eed93945391c2d0a25120136267
5 files changed