/** * Returns the number of purchases for the specified item. Refunded and cancelled purchases are * not subtracted. See {@link #countPurchasesNet(Context, String)} if they need to be. * * @param context * @param itemId id of the item whose purchases will be counted. * @return number of purchases for the specified item. */ public static int countPurchases(Context context, String itemId) { final byte[] salt = getSalt(); itemId = salt != null ? Security.obfuscate(context, salt, itemId) : itemId; return TransactionManager.countPurchases(context, itemId); }