From 191f14c754a574037daf66adee1a80474236dc25 Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Wed, 16 May 2018 19:04:31 +0300 Subject: [PATCH 1/2] Remove unused fields --- .../osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index 5fbc18ba4c..e17c31b794 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -260,10 +260,6 @@ public class RouteInfoWidgetsFactory { public TextInfoWidget createTimeControl(final MapActivity map, final boolean intermediate){ final RoutingHelper routingHelper = map.getRoutingHelper(); - final int time = R.drawable.widget_time_day; - final int timeN = R.drawable.widget_time_night; - final int timeToGo = R.drawable.widget_time_to_distance_day; - final int timeToGoN = R.drawable.widget_time_to_distance_night; final OsmandApplication ctx = map.getMyApplication(); final OsmandPreference showArrival = intermediate ? ctx.getSettings().SHOW_INTERMEDIATE_ARRIVAL_TIME_OTHERWISE_EXPECTED_TIME From 574c1192a7b3befa486318b1ac1530bfe019ce24 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 16 May 2018 20:01:42 +0300 Subject: [PATCH 2/2] Fix inapp cancel dialog --- OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java b/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java index 9a60d06d75..428627128f 100644 --- a/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java +++ b/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java @@ -361,19 +361,18 @@ public class InAppPurchaseHelper { Purchase liveUpdatesPurchase = inventory.getPurchase(SKU_LIVE_UPDATES); boolean subscribedToLiveUpdates = (liveUpdatesPurchase != null && liveUpdatesPurchase.getPurchaseState() == 0); OsmandPreference subscriptionCancelledTime = ctx.getSettings().LIVE_UPDATES_PURCHASE_CANCELLED_TIME; - if (!subscribedToLiveUpdates) { + if (!subscribedToLiveUpdates && ctx.getSettings().LIVE_UPDATES_PURCHASED.get()) { if (subscriptionCancelledTime.get() == 0) { subscriptionCancelledTime.set(System.currentTimeMillis()); ctx.getSettings().LIVE_UPDATES_PURCHASE_CANCELLED_FIRST_DLG_SHOWN.set(false); ctx.getSettings().LIVE_UPDATES_PURCHASE_CANCELLED_SECOND_DLG_SHOWN.set(false); - } else if (System.currentTimeMillis() - subscriptionCancelledTime.get() > SUBSCRIPTION_HOLDING_TIME_MSEC - && ctx.getSettings().LIVE_UPDATES_PURCHASED.get()) { + } else if (System.currentTimeMillis() - subscriptionCancelledTime.get() > SUBSCRIPTION_HOLDING_TIME_MSEC) { ctx.getSettings().LIVE_UPDATES_PURCHASED.set(false); if (!isDepthContoursPurchased(ctx)) { ctx.getSettings().getCustomRenderBooleanProperty("depthContours").set(false); } } - } else { + } else if (subscribedToLiveUpdates) { subscriptionCancelledTime.set(0L); ctx.getSettings().LIVE_UPDATES_PURCHASED.set(true); }