[native] Stop backup client in background
Summary:
ENG-6215
Improve the backup client upload handler lifecycle. We want to close it when we go into the background and open when the app is foregrounded.
Depends on D11044
Test Plan:
- Enable upload handler
- Observe logs in the backup service to see when the socket is opened/closed
- Make sure that when the app is backgrounded the socket is closed (gracefully and not because of a timeout)
- Make sure that when the app is foregrounded the socket is opened (without waiting for some accidental re-render)
Reviewers: marcin, bartek, kamil
Reviewed By: marcin, kamil
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11074