Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Yunitsky <yunik@mapswithme.com>2015-08-11 14:09:17 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:00:44 +0300
commit3d8126cdf5bb4b76b032529f957c9723bd6e808d (patch)
treedb12d33cf41a9cd663d67964c9503029204a2493
parentb95fc5602c66aaa060b6b40985ebbc71a7cc245a (diff)
[android] Fixed possible crashes.
-rw-r--r--android/src/com/mapswithme/maps/MWMActivity.java4
-rw-r--r--android/src/com/mapswithme/maps/widget/RoutingLayout.java4
-rw-r--r--android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java2
3 files changed, 8 insertions, 2 deletions
diff --git a/android/src/com/mapswithme/maps/MWMActivity.java b/android/src/com/mapswithme/maps/MWMActivity.java
index fac141bb37..10deb18735 100644
--- a/android/src/com/mapswithme/maps/MWMActivity.java
+++ b/android/src/com/mapswithme/maps/MWMActivity.java
@@ -705,10 +705,12 @@ public class MWMActivity extends BaseMwmFragmentActivity
{
mLayoutRouting.updateRouteInfo();
- // TODO think about moving TtsPlayer logic to RoutingLayout to minimyze native calls.
+ // TODO think about moving TtsPlayer logic to RoutingLayout to minimize native calls.
if (state == RoutingLayout.State.TURN_INSTRUCTIONS)
{
RoutingInfo info = Framework.nativeGetRouteFollowingInfo();
+ if (info == null)
+ return;
TtsPlayer.INSTANCE.speakNotifications(info.turnNotifications);
}
}
diff --git a/android/src/com/mapswithme/maps/widget/RoutingLayout.java b/android/src/com/mapswithme/maps/widget/RoutingLayout.java
index 35367b11e8..f76dc21c61 100644
--- a/android/src/com/mapswithme/maps/widget/RoutingLayout.java
+++ b/android/src/com/mapswithme/maps/widget/RoutingLayout.java
@@ -274,6 +274,8 @@ public class RoutingLayout extends FrameLayout implements CompoundButton.OnCheck
private void refreshTurnInstructions()
{
RoutingInfo info = Framework.nativeGetRouteFollowingInfo();
+ if (info == null)
+ return;
if (Framework.getRouter() == Framework.ROUTER_TYPE_VEHICLE)
{
@@ -305,6 +307,8 @@ public class RoutingLayout extends FrameLayout implements CompoundButton.OnCheck
private void refreshRouteSetup()
{
RoutingInfo info = Framework.nativeGetRouteFollowingInfo();
+ if (info == null)
+ return;
mTvPrepareDistance.setText(info.distToTarget + " " + info.targetUnits.toUpperCase());
mTvPrepareTime.setText(formatTime(info.totalTimeInSeconds));
diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
index 46ba036ab3..4ce62ca0e4 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java
@@ -634,7 +634,7 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene
if (ParsedMwmRequest.hasRequest())
{
final ParsedMwmRequest request = ParsedMwmRequest.getCurrentRequest();
- if (request.isPickPointMode())
+ if (ParsedMwmRequest.isPickPointMode())
request.setPointData(mMapObject.getLat(), mMapObject.getLon(), mMapObject.getName(), "");
request.sendResponseAndFinish(activity, true);
}