Move the code for camera management to its own task in the AsyncTaskManager to enable executing it in a separate thread.