public static double getAltitude(final Location geo) {
        if (Double.isNaN(mslCorrection) || (mslLastReading != null && mslLastReading.distanceTo(new Geopoint(geo.getLatitude(), geo.getLongitude())) > MAX_DISTANCE)) {
            if (!mslRetrievalOngoing.get()) {
                // trigger download of msl correction, if not yet available
                mslRetrievalOngoing.set(true);
                final Location dummy = new Location(geo);
                dummy.setAltitude(0d);
                AndroidRxUtils.networkScheduler.scheduleDirect(() -> {
                    try {
                        AltitudeConverterCompat.addMslAltitudeToLocation(CgeoApplication.getInstance().getApplicationContext(), dummy);
                        if (LocationCompat.hasMslAltitude(dummy)) {
                            mslCorrection = LocationCompat.getMslAltitudeMeters(dummy);
                            mslLastReading = new Geopoint(geo.getLatitude(), geo.getLongitude());
                        }
                    } catch (IOException ignore) {
                        // ignore
                    } finally {
                        mslRetrievalOngoing.set(false);
                    }
                });
            }
            return geo.getAltitude();
        } else {
            return geo.getAltitude() + mslCorrection;
        }
    }
returns altitude in meters; prefers msl altitude if available
main/src/main/java/cgeo/geocaching/utils/GeoHeightUtils.java