Fix request inventory

This commit is contained in:
crimean 2018-11-02 22:33:25 +03:00
parent 855b717dfe
commit df7d9d36bc

View file

@ -67,6 +67,7 @@ public class InAppPurchaseHelper {
private String token = "";
private InAppPurchaseTaskType activeTask;
private boolean processingTask = false;
private boolean inventoryRequestPending = false;
private OsmandApplication ctx;
private InAppPurchaseListener uiActivity = null;
@ -180,7 +181,10 @@ public class InAppPurchaseHelper {
}
if (processingTask) {
logError("Already processing task: " + taskType + ". Exit.");
if (taskType == InAppPurchaseTaskType.REQUEST_INVENTORY) {
inventoryRequestPending = true;
}
logError("Already processing task: " + activeTask + ". Exit.");
return;
}
@ -700,6 +704,10 @@ public class InAppPurchaseHelper {
processingTask = false;
activeTask = null;
}
if (inventoryRequestPending) {
inventoryRequestPending = false;
requestInventory();
}
}
private void sendTokens(@NonNull final List<Purchase> purchases, final OnRequestResultListener listener) {