Don't show toast while canceling purchase

This commit is contained in:
crimean 2018-10-24 11:33:06 +03:00
parent 9da7469c17
commit c486f903e2

View file

@ -34,6 +34,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static net.osmand.plus.inapp.util.IabHelper.IABHELPER_USER_CANCELLED;
public class InAppPurchaseHelper { public class InAppPurchaseHelper {
// Debug tag, for logging // Debug tag, for logging
private static final String TAG = InAppPurchaseHelper.class.getSimpleName(); private static final String TAG = InAppPurchaseHelper.class.getSimpleName();
@ -588,7 +590,9 @@ public class InAppPurchaseHelper {
} }
if (result.isFailure()) { if (result.isFailure()) {
complain("Error purchasing: " + result); if (result.getResponse() != IABHELPER_USER_CANCELLED) {
complain("Error purchasing: " + result);
}
notifyDismissProgress(activeTask); notifyDismissProgress(activeTask);
notifyError(activeTask, "Error purchasing: " + result); notifyError(activeTask, "Error purchasing: " + result);
stop(true); stop(true);