forked from organicmaps/organicmaps
[android] Fixed disabling of locals ads on the start if subscription is active
This commit is contained in:
parent
1583278a36
commit
14c36ba25c
2 changed files with 3 additions and 4 deletions
|
@ -92,8 +92,7 @@ class AdsRemovalPurchaseController extends AbstractPurchaseController<AdsRemoval
|
|||
{
|
||||
for (Purchase purchase : purchases)
|
||||
{
|
||||
LOGGER.i(TAG, "Validating 'ads removal' purchased '" + purchase.getSku()
|
||||
+ "' on backend server...");
|
||||
LOGGER.i(TAG, "Validating purchase '" + purchase.getSku() + "' on backend server...");
|
||||
getValidator().validate(purchase.getOriginalJson());
|
||||
if (getUiCallback() != null)
|
||||
getUiCallback().onValidationStarted();
|
||||
|
|
|
@ -481,8 +481,8 @@ Framework::Framework(FrameworkParams const & params)
|
|||
// Local ads manager should be initialized after storage initialization.
|
||||
if (params.m_enableLocalAds)
|
||||
{
|
||||
m_localAdsManager.Startup(m_bmManager.get(),
|
||||
m_purchase->IsSubscriptionActive(SubscriptionType::RemoveAds));
|
||||
auto const isActive = m_purchase->IsSubscriptionActive(SubscriptionType::RemoveAds);
|
||||
m_localAdsManager.Startup(m_bmManager.get(), !isActive);
|
||||
m_purchase->RegisterSubscription(&m_localAdsManager);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue