ohos: Restart the camera session when returning to the foreground


HarmonyOS revokes camera access while the application is in the
background, and the plugin registers no camera error callback, so the
capture session is left dead with no notification and nothing ever
restarts it.

Track the application state the way the Android camera session does:
release the session on the way out, and build a new one once the
application becomes active again. A request to start made while in the
background is kept and applied on return, and an explicit stop clears
it so a camera the application turned off is not silently restarted.

This does not on its own restore the picture after a suspend and
resume, because the video renderer stops consuming frames at that
point. That is a separate problem.

Pick-to: 6.12
Change-Id: Ie364857230dd43114577e54c808136a02f9d7a48
Reviewed-by: Shane Liu <shane.liu@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
commit15d0390a764f7109354e49886fc8fbc085c73a41
parentdb45b625dc7563bf796ef8a1e3a053f89918979c
authorAndy Nichols <andy.nichols@qt.io>
committerAndy Nichols <andy.nichols@qt.io>
commit timeTue, 29 Sep 2026 08:07:59 +0000