Android: Use a dedicated thread for camera callbacks
Camera availability callbacks were handled by a Handler using the
Android UI thread looper. During application teardown, the Android UI
thread blocks waiting for the Qt main thread to exit. If the Qt main
thread destroys QAndroidVideoDevices, it posts cleanup to the blocked UI
looper causing a deadlock.
This patch adds a dedicated HandlerThread for camera availability
callbacks, so cleanup no longer depends on the UI thread's looper.
This is the same fix that was applied to audio device callbacks in the
fix for QTBUG-147200.
Fixes: QTBUG-149229
Pick-to: 6.12 6.11
Change-Id: I4bb8f59dc7670a9777edf6664fad85ba2add72e9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Nils Petter Skålerud <nils.petter.skalerud@qt.io>