@Override public void consume(@NonNull Purchase purchase) throws BillingException { try { int rc = delegate.consumePurchase(3, packageName, purchase.purchaseToken()); BillingException.checkCode(rc); } catch (RemoteException e) { throw new UnsupportedOperationException(e); } }
@Override public boolean arePurchasesSupported(@NonNull @ProductType String type) throws BillingException { try { int rc = delegate.isBillingSupported(API_VERSION, packageName, type); BillingException.checkCode(rc); return true; } catch (RemoteException e) { throw new BillingException(e); } }
private void checkBundle(Bundle bundle) throws BillingException { int code = bundle.getInt("RESPONSE_CODE"); BillingException.checkCode(code); }