[android] Partial fix for 478 - do not go to idle when my position is enabled

@TODO for correct implementation small refactoring is needed - do not go to idle only when centering is enabled in the framework
This commit is contained in:
Alex Zolotarev 2012-02-02 19:01:34 +03:00 committed by Alex Zolotarev
parent f7a60a238e
commit 623c59fd73

View file

@ -4,6 +4,8 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import com.mapswithme.maps.MWMActivity;
import android.content.Context;
import android.hardware.GeomagneticField;
import android.hardware.Sensor;
@ -14,6 +16,8 @@ import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
public class LocationService implements LocationListener, SensorEventListener, WifiLocation.Listener
@ -127,6 +131,7 @@ public class LocationService implements LocationListener, SensorEventListener, W
if (m_wifiScanner == null)
m_wifiScanner = new WifiLocation();
m_wifiScanner.StartScan(c, this);
disableAutomaticStandby();
}
else
observer.onLocationStatusChanged(DISABLED_BY_USER);
@ -135,6 +140,7 @@ public class LocationService implements LocationListener, SensorEventListener, W
{
m_isActive = true;
observer.onLocationStatusChanged(STARTED);
disableAutomaticStandby();
for (String provider : enabledProviders)
{
@ -169,6 +175,7 @@ public class LocationService implements LocationListener, SensorEventListener, W
m_isActive = false;
m_reportFirstUpdate = true;
m_magneticField = null;
enableAutomaticStandby();
}
observer.onLocationStatusChanged(STOPPED);
}