question: public static boolean isValidLocation ( Location location ) { return location != null && Math . abs ( location . getLatitude ( ) ) <= 90 && Math . abs ( location . getLongitude ( ) ) <= 180 ; }
target:  Checks if a given location is a valid (i.e. physically possible) location on Earth. Note: The special separator locations (which have latitude = 100) will not qualify as valid. Neither will locations with lat=0 and lng=0 as these are most likely "bad" measurements which often cause trouble.