MCPcopy Index your code
hub / github.com/M66B/NetGuard / getBuyIntent

Method getBuyIntent

app/src/main/java/eu/faircode/netguard/IAB.java:157–170  ·  view source on GitHub ↗
(String sku, boolean subscription)

Source from the content-addressed store, hash-verified

155 }
156
157 public PendingIntent getBuyIntent(String sku, boolean subscription) throws RemoteException {
158 if (service == null)
159 return null;
160 Bundle bundle = service.getBuyIntent(IAB_VERSION, context.getPackageName(), sku, subscription ? "subs" : "inapp", "netguard");
161 Log.i(TAG, "getBuyIntent sku=" + sku + " subscription=" + subscription);
162 Util.logBundle(bundle);
163 int response = (bundle == null ? -1 : bundle.getInt("RESPONSE_CODE", -1));
164 Log.i(TAG, "Response=" + getResult(response));
165 if (response != 0)
166 throw new IllegalArgumentException(getResult(response));
167 if (!bundle.containsKey("BUY_INTENT"))
168 throw new IllegalArgumentException("BUY_INTENT missing");
169 return bundle.getParcelable("BUY_INTENT");
170 }
171
172 public static void setBought(String sku, Context context) {
173 Log.i(TAG, "Bought " + sku);

Callers 1

onClickMethod · 0.80

Calls 2

logBundleMethod · 0.95
getResultMethod · 0.95

Tested by

no test coverage detected