Oh wait, I think I see. lib/camera.js already has a state variable 'focus' with values 'none', 'focusing', 'focused' and 'fail'.  I suspect that you can use that and don't need setTouchFocusDone() at all.