diff --git a/android/src/com/mapswithme/maps/LocationState.java b/android/src/com/mapswithme/maps/LocationState.java index 86edae96bf..37a1001405 100644 --- a/android/src/com/mapswithme/maps/LocationState.java +++ b/android/src/com/mapswithme/maps/LocationState.java @@ -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(); diff --git a/android/src/com/mapswithme/maps/MWMActivity.java b/android/src/com/mapswithme/maps/MWMActivity.java index ee36facf16..e568dd4309 100644 --- a/android/src/com/mapswithme/maps/MWMActivity.java +++ b/android/src/com/mapswithme/maps/MWMActivity.java @@ -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; diff --git a/android/src/com/mapswithme/maps/location/LocationPredictor.java b/android/src/com/mapswithme/maps/location/LocationPredictor.java index 2adae3ba62..3e65cbcbf7 100644 --- a/android/src/com/mapswithme/maps/location/LocationPredictor.java +++ b/android/src/com/mapswithme/maps/location/LocationPredictor.java @@ -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) {