forked from organicmaps/organicmaps
[android] Added subscription deactivation if sdk returns empty purchase list
This commit is contained in:
parent
70c190e07a
commit
59404a74d9
1 changed files with 7 additions and 0 deletions
|
@ -68,6 +68,8 @@ class AdsRemovalPurchaseController extends AbstractPurchaseController<AdsRemoval
|
|||
{
|
||||
LOGGER.i(TAG, "Validation status of 'ads removal': " + status);
|
||||
boolean activateSubscription = status != AdsRemovalValidationStatus.NOT_VERIFIED;
|
||||
LOGGER.i(TAG, "Ads removal subscription "
|
||||
+ (activateSubscription ? "activated" : "deactivated"));
|
||||
Framework.nativeSetActiveRemoveAdsSubscription(activateSubscription);
|
||||
if (activateSubscription)
|
||||
Statistics.INSTANCE.trackPurchaseProductDelivered(PrivateVariables.adsRemovalVendor());
|
||||
|
@ -127,6 +129,11 @@ class AdsRemovalPurchaseController extends AbstractPurchaseController<AdsRemoval
|
|||
if (TextUtils.isEmpty(purchaseData))
|
||||
{
|
||||
LOGGER.i(TAG, "Existing purchase data for 'ads removal' not found");
|
||||
if (Framework.nativeHasActiveRemoveAdsSubscription())
|
||||
{
|
||||
LOGGER.i(TAG, "Ads removal subscription deactivated");
|
||||
Framework.nativeSetActiveRemoveAdsSubscription(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue