Fix for location buggy state button.

This commit is contained in:
Dmitry Yunitsky 2015-06-07 02:40:45 +03:00 committed by Alex Zolotarev
parent 54e1bb325a
commit 37efd0b3c8
3 changed files with 13 additions and 2 deletions

View file

@ -14,12 +14,23 @@ public enum LocationState
public static final int FOLLOW = 0x3;
public static final int ROTATE_AND_FOLLOW = 0x4;
public static final int SLOT_UNDEFINED = -1;
public native void switchToNextMode();
public native int getLocationStateMode();
/*
* Adds listener
* @param l
* @return slotId of added listener
*/
public native int addLocationStateModeListener(Object l);
/**
* Removes listener with slotId
* @param slotID slotId of listener to remove
*/
public native void removeLocationStateModeListener(int slotID);
public native void turnOff();

View file

@ -137,7 +137,7 @@ public class MWMActivity extends BaseMwmFragmentActivity
private TextView mTvTurnDistance;
private boolean mNeedCheckUpdate = true;
private int mLocationStateModeListenerId = -1;
private int mLocationStateModeListenerId = LocationState.SLOT_UNDEFINED;
// Initialized to invalid combination to force update on the first check
private boolean mStorageAvailable = false;
private boolean mStorageWritable = true;

View file

@ -18,7 +18,7 @@ public class LocationPredictor
private Location mLastLocation;
private boolean mGeneratePredictions;
private int mPredictionCount;
private int mConnectionSlot;
private int mConnectionSlot = LocationState.SLOT_UNDEFINED;
public LocationPredictor(Handler handler, LocationHelper.LocationListener listener)
{