Pulled out wakelock logic from camera.js and filmstrip.js