optimize gps for onPause and onResume