From fcac4fec0302fdc84b2a1d35acb62e594f449e55 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 23 Nov 2015 11:05:44 +0100 Subject: [PATCH] Report IAB errors --- app/src/main/java/eu/faircode/netguard/IAB.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/IAB.java b/app/src/main/java/eu/faircode/netguard/IAB.java index 4d101bc7..e1179183 100644 --- a/app/src/main/java/eu/faircode/netguard/IAB.java +++ b/app/src/main/java/eu/faircode/netguard/IAB.java @@ -113,8 +113,10 @@ public class IAB implements ServiceConnection { Util.logBundle(bundle); int response = (bundle == null ? -1 : bundle.getInt("RESPONSE_CODE", -1)); Log.i(TAG, "Response=" + getIABResult(response)); - if (response != 0) + if (response != 0) { + Util.sendCrashReport(new IllegalStateException(getIABResult(response)), context); return false; + } // Check available SKUs boolean found = false; @@ -139,8 +141,10 @@ public class IAB implements ServiceConnection { Util.logBundle(bundle); int response = (bundle == null ? -1 : bundle.getInt("RESPONSE_CODE", -1)); Log.i(TAG, "Response=" + getIABResult(response)); - if (response != 0) + if (response != 0) { + Util.sendCrashReport(new IllegalStateException(getIABResult(response)), context); return false; + } // Check purchases ArrayList skus = bundle.getStringArrayList("INAPP_PURCHASE_ITEM_LIST"); @@ -153,8 +157,10 @@ public class IAB implements ServiceConnection { Util.logBundle(bundle); int response = (bundle == null ? -1 : bundle.getInt("RESPONSE_CODE", -1)); Log.i(TAG, "Response=" + getIABResult(response)); - if (response != 0 || !bundle.containsKey("BUY_INTENT")) + if (response != 0 || !bundle.containsKey("BUY_INTENT")) { + Util.sendCrashReport(new IllegalStateException(getIABResult(response)), context); return null; + } return bundle.getParcelable("BUY_INTENT"); }