if(!isModeValid(mode)){
throw new IllegalArgumentException("Mode: " + mode + " is invalid. Please use one of SimpleLocationProvider.MODE_*.");
}
if(!isModeAvailable(mode)){
throw new LocationException(getModeString(mode) + " is not currently available on this device.");
}
lastValidFixTime = System.currentTimeMillis();
currentOptimalModeIsGeolocation = true;
switchToGPS = false;
if(trackingInProgress){