<commit_before>package org.osmdroid;

import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;

public class LocationListenerProxy implements LocationListener
{
	private final LocationManager mLocationManager;
	private LocationListener mListener = null;

	public LocationListenerProxy(final LocationManager pLocationManager) {
		mLocationManager = pLocationManager;
	}

	public void startListening(final LocationListener pListener,
			final long pUpdateTime, final float pUpdateDistance) {
		mListener = pListener;
		mLocationManager.requestLocationUpdates(
				LocationManager.GPS_PROVIDER, pUpdateTime, pUpdateDistance, this);
		mLocationManager.requestLocationUpdates(
				LocationManager.NETWORK_PROVIDER, pUpdateTime, pUpdateDistance, this);
	}

	public void stopListening() {
		mListener = null;
		mLocationManager.removeUpdates(this);
	}

	@Override
	public void onLocationChanged(final Location arg0) {
		if( mListener != null ) {
			mListener.onLocationChanged(arg0);
		}
	}

	@Override
	public void onProviderDisabled(final String arg0) {
		if( mListener != null ) {
			mListener.onProviderDisabled(arg0);
		}
	}

	@Override
	public void onProviderEnabled(final String arg0) {
		if( mListener != null ) {
			mListener.onProviderEnabled(arg0);
		}
	}
<commit_msg>LocationListenerProxy requests illegal providers. Fixes issue 167.<commit_after>package org.osmdroid;

import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;

public class LocationListenerProxy implements LocationListener
{
	private final LocationManager mLocationManager;
	private LocationListener mListener = null;

	public LocationListenerProxy(final LocationManager pLocationManager) {
		mLocationManager = pLocationManager;
	}

	public void startListening(final LocationListener pListener,
			final long pUpdateTime, final float pUpdateDistance) {
		mListener = pListener;
		for (final String provider : mLocationManager.getProviders(true)) {
			if (LocationManager.GPS_PROVIDER.equals(provider)
					|| LocationManager.NETWORK_PROVIDER.equals(provider)) {
				mLocationManager.requestLocationUpdates(provider,
						pUpdateTime, pUpdateDistance, this);
			}
		}
	}

	public void stopListening() {
		mListener = null;
		mLocationManager.removeUpdates(this);
	}

	@Override
	public void onLocationChanged(final Location arg0) {
		if( mListener != null ) {
			mListener.onLocationChanged(arg0);
		}
	}

	@Override
	public void onProviderDisabled(final String arg0) {
		if( mListener != null ) {
			mListener.onProviderDisabled(arg0);
		}
	}

	@Override
	public void onProviderEnabled(final String arg0) {
		if( mListener != null ) {
			mListener.onProviderEnabled(arg0);
		}
	}

{'fraction_non_alphanumeric': 0.08029713477184294, 'fraction_numerical': 0.005305978068623983, 'mean_word_length': 5.45662100456621, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4668226', 'n_tokens_mistral': 880, 'n_tokens_neox': 802, 'n_words': 184}