internal SingleLocationListener(LocationManager manager, float desiredAccuracy, IEnumerable <string> activeProviders)
        {
            this.desiredAccuracy = desiredAccuracy;

            this.activeProviders = new HashSet <string>(activeProviders);

            foreach (var provider in activeProviders)
            {
                var location = manager.GetLastKnownLocation(provider);
                if (location != null && Geolocation.IsBetterLocation(location, BestLocation))
                {
                    BestLocation = location;
                }
            }
        }
        void ILocationListener.OnLocationChanged(AndroidLocation location)
        {
            if (location.Accuracy <= desiredAccuracy)
            {
                if (wasRaised)
                {
                    return;
                }

                wasRaised = true;

                LocationHandler?.Invoke(location);
                return;
            }

            lock (locationSync)
            {
                if (Geolocation.IsBetterLocation(location, BestLocation))
                {
                    BestLocation = location;
                }
            }
        }