private void startPortMappingLifetimeMeasurement(SipProfile localProfile, int maxInterval) { if ((mIntervalMeasurementProcess == null) && (mKeepAliveInterval == -1) && isBehindNAT(mLocalIp)) { Log.d(TAG, "start NAT port mapping timeout measurement on " + localProfile.getUriString()); int minInterval = mLastGoodKeepAliveInterval; if (minInterval >= maxInterval) { // If mLastGoodKeepAliveInterval also does not work, reset it // to the default min minInterval = mLastGoodKeepAliveInterval = DEFAULT_KEEPALIVE_INTERVAL; Log.d(TAG, " reset min interval to " + minInterval); } mIntervalMeasurementProcess = new IntervalMeasurementProcess(localProfile, minInterval, maxInterval); mIntervalMeasurementProcess.start(); } }
private void stopPortMappingMeasurement() { if (mIntervalMeasurementProcess != null) { mIntervalMeasurementProcess.stop(); mIntervalMeasurementProcess = null; } }