forked from organicmaps/organicmaps
[android] Added handling of bookmark inapp details loading failure
This commit is contained in:
parent
39a7ccbe40
commit
1dfa1535f3
6 changed files with 14 additions and 11 deletions
|
@ -387,5 +387,12 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
|
|||
LOGGER.i(TAG, "Product details for web catalog loaded: " + details);
|
||||
loadCatalog(PurchaseUtils.toProductDetailsBundle(details));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProductDetailsFailure()
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to load product details for web catalog");
|
||||
loadCatalog(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ public abstract class AbstractProductDetailsLoadingCallback implements PlayStore
|
|||
{
|
||||
public abstract void onProductDetailsLoaded(@NonNull List<SkuDetails> details);
|
||||
|
||||
public abstract void onProductDetailsFailure();
|
||||
|
||||
@Override
|
||||
public void onPurchaseSuccessful(@NonNull List<Purchase> purchases)
|
||||
{
|
||||
|
@ -23,12 +25,6 @@ public abstract class AbstractProductDetailsLoadingCallback implements PlayStore
|
|||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPurchaseDetailsFailure()
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStoreConnectionFailed()
|
||||
{
|
||||
|
|
|
@ -172,7 +172,7 @@ abstract class AbstractPurchaseController<V, B, UiCallback extends PurchaseCallb
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onPurchaseDetailsFailure()
|
||||
public void onProductDetailsFailure()
|
||||
{
|
||||
if (getUiCallback() != null)
|
||||
getUiCallback().onProductDetailsFailure();
|
||||
|
|
|
@ -149,7 +149,7 @@ public class FailedBookmarkPurchaseController implements PurchaseController<Fail
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onPurchaseDetailsFailure()
|
||||
public void onProductDetailsFailure()
|
||||
{
|
||||
// Do nothing by default.
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ public interface PlayStoreBillingCallback
|
|||
void onProductDetailsLoaded(@NonNull List<SkuDetails> details);
|
||||
void onPurchaseSuccessful(@NonNull List<Purchase> purchases);
|
||||
void onPurchaseFailure(@BillingClient.BillingResponse int error);
|
||||
void onPurchaseDetailsFailure();
|
||||
void onProductDetailsFailure();
|
||||
void onStoreConnectionFailed();
|
||||
void onPurchasesLoaded(@NonNull List<Purchase> purchases);
|
||||
void onConsumptionSuccess();
|
||||
|
|
|
@ -44,7 +44,7 @@ class QueryProductDetailsRequest extends PlayStoreBillingRequest<PlayStoreBillin
|
|||
{
|
||||
LOGGER.w(TAG, "Unsuccessful request");
|
||||
if (getCallback() != null)
|
||||
getCallback().onPurchaseDetailsFailure();
|
||||
getCallback().onProductDetailsFailure();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ class QueryProductDetailsRequest extends PlayStoreBillingRequest<PlayStoreBillin
|
|||
{
|
||||
LOGGER.w(TAG, "Purchase details not found");
|
||||
if (getCallback() != null)
|
||||
getCallback().onPurchaseDetailsFailure();
|
||||
getCallback().onProductDetailsFailure();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue