static void isNotNull(@Nullable Object o) { isNotNull(o, "Object should not be null"); }
@Override void start(@Nonnull IInAppBillingService service, @Nonnull String packageName) throws RemoteException, RequestException { final Bundle bundle = service.getBuyIntentToReplaceSkus(mApiVersion, packageName, mOldSkus, mNewSku, mProduct, mPayload == null ? "" : mPayload); if (handleError(bundle)) { return; } final PendingIntent pendingIntent = bundle.getParcelable("BUY_INTENT"); Check.isNotNull(pendingIntent); onSuccess(pendingIntent); }
@Override void start(@Nonnull IInAppBillingService service, @Nonnull String packageName) throws RemoteException, RequestException { final String payload = mPayload == null ? "" : mPayload; final Bundle bundle = mExtraParams != null ? service.getBuyIntentExtraParams(mApiVersion, packageName, mSku, mProduct, payload, mExtraParams) : service.getBuyIntent(mApiVersion, packageName, mSku, mProduct, payload); if (handleError(bundle)) { return; } final PendingIntent pendingIntent = bundle.getParcelable("BUY_INTENT"); Check.isNotNull(pendingIntent); onSuccess(pendingIntent); }
Check.isNotNull(mRequests); final Billing.Requests requests = mRequests;
void onActivityResult(int requestCode, int resultCode, Intent intent) { try { Check.equals(mRequestCode, requestCode); if (intent == null) { // sometimes intent is null (it's not obvious when it happens but it happens from time to time) handleError(NULL_INTENT); return; } final int responseCode = intent.getIntExtra(EXTRA_RESPONSE, OK); if (resultCode != RESULT_OK || responseCode != OK) { handleError(responseCode); return; } final String data = intent.getStringExtra(EXTRA_PURCHASE_DATA); final String signature = intent.getStringExtra(EXTRA_PURCHASE_SIGNATURE); Check.isNotNull(data); Check.isNotNull(signature); final Purchase purchase = Purchase.fromJson(data, signature); mVerifier.verify(singletonList(purchase), new VerificationListener()); } catch (RuntimeException | JSONException e) { handleError(e); } }
Check.isNotNull(localService);