diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index b48bea37df..93b7f97da9 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -926,6 +926,8 @@ public class OsmandSettings { public static final String BILLING_USER_DONATION_WORLD_PARAMETER = ""; public static final String BILLING_USER_DONATION_NONE_PARAMETER = "none"; + public final OsmandPreference INAPPS_READ = new BooleanPreference("inapps_read", false).makeGlobal(); + public final OsmandPreference BILLING_USER_ID = new StringPreference("billing_user_id", "").makeGlobal(); public final OsmandPreference BILLING_USER_TOKEN = new StringPreference("billing_user_token", "").makeGlobal(); public final OsmandPreference BILLING_USER_NAME = new StringPreference("billing_user_name", "").makeGlobal(); diff --git a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java index be5cc51514..44987b5ba3 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java @@ -43,16 +43,17 @@ public class DiscountHelper { public static void checkAndDisplay(final MapActivity mapActivity) { - if (mapActivity.getMyApplication().getSettings().DO_NOT_SHOW_STARTUP_MESSAGES.get()) { + OsmandApplication app = mapActivity.getMyApplication(); + OsmandSettings settings = app.getSettings(); + if (settings.DO_NOT_SHOW_STARTUP_MESSAGES.get() || !settings.INAPPS_READ.get()) { return; } if (mBannerVisible) { showDiscountBanner(mapActivity, mTitle, mDescription, mIcon, mUrl); } - OsmandApplication app = mapActivity.getMyApplication(); if (System.currentTimeMillis() - mLastCheckTime < 1000 * 60 * 60 * 24 - || !app.getSettings().isInternetConnectionAvailable() - || app.getSettings().NO_DISCOUNT_INFO.get()) { + || !settings.isInternetConnectionAvailable() + || settings.NO_DISCOUNT_INFO.get()) { return; } mLastCheckTime = System.currentTimeMillis(); diff --git a/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java b/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java index 90fe39c669..40f7db1c2e 100644 --- a/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java +++ b/OsmAnd/src/net/osmand/plus/inapp/InAppHelper.java @@ -363,9 +363,11 @@ public class InAppHelper { mFullVersionPrice = fullPriceDetails.getPrice(); } + OsmandSettings settings = ctx.getSettings(); + settings.INAPPS_READ.set(true); + boolean needSendToken = false; if (!isDeveloperVersion && liveUpdatesPurchase != null) { - OsmandSettings settings = ctx.getSettings(); if ((Algorithms.isEmpty(settings.BILLING_USER_ID.get()) || Algorithms.isEmpty(settings.BILLING_USER_TOKEN.get())) && !Algorithms.isEmpty(liveUpdatesPurchase.getDeveloperPayload())) { String payload = liveUpdatesPurchase.getDeveloperPayload();