From 82f2138c07c91b45e687a3e01bb5a65fbea71c58 Mon Sep 17 00:00:00 2001 From: cepprice Date: Fri, 5 Mar 2021 20:41:40 +0500 Subject: [PATCH] Small renaming --- .../plus/inapp/InAppPurchaseHelperImpl.java | 12 +++++------ .../plus/inapp/util/BillingManager.java | 20 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src-google/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java b/OsmAnd/src-google/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java index 7ea9e7a1d3..cab2719f80 100644 --- a/OsmAnd/src-google/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java +++ b/OsmAnd/src-google/net/osmand/plus/inapp/InAppPurchaseHelperImpl.java @@ -200,7 +200,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { BillingManager billingManager = getBillingManager(); if (billingManager != null) { - storeUserInfo(billingManager); + setupUserInfo(billingManager); billingManager.initiatePurchaseFlow(activity, skuDetails); } else { throw new IllegalStateException("BillingManager disposed"); @@ -228,7 +228,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { } BillingManager billingManager = getBillingManager(); if (billingManager != null) { - storeUserInfo(billingManager); + setupUserInfo(billingManager); billingManager.initiatePurchaseFlow(activity, skuDetails); } else { throw new IllegalStateException("BillingManager disposed"); @@ -568,7 +568,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { if (AndroidUtils.isActivityNotDestroyed(a) && skuDetails != null) { BillingManager billingManager = getBillingManager(); if (billingManager != null) { - storeUserInfo(billingManager); + setupUserInfo(billingManager); billingManager.initiatePurchaseFlow(a, skuDetails); } else { throw new IllegalStateException("BillingManager disposed"); @@ -620,10 +620,10 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper { onPurchaseDone(getPurchaseInfo(purchase)); } - private void storeUserInfo(BillingManager billingManager) { + private void setupUserInfo(BillingManager billingManager) { OsmandSettings settings = ctx.getSettings(); - billingManager.setUserId(settings.BILLING_USER_ID.get()); - billingManager.setUserToken(settings.BILLING_USER_TOKEN.get()); + billingManager.setObfuscatedAccountId(settings.BILLING_USER_ID.get()); + billingManager.setObfuscatedProfileId(settings.BILLING_USER_TOKEN.get()); } @Override diff --git a/OsmAnd/src/net/osmand/plus/inapp/util/BillingManager.java b/OsmAnd/src/net/osmand/plus/inapp/util/BillingManager.java index f06d577219..b11bcaec80 100644 --- a/OsmAnd/src/net/osmand/plus/inapp/util/BillingManager.java +++ b/OsmAnd/src/net/osmand/plus/inapp/util/BillingManager.java @@ -58,8 +58,8 @@ public class BillingManager implements PurchasesUpdatedListener { // Public key for verifying signature, in base64 encoding private String mSignatureBase64; - private String mUserId; - private String mUserToken; + private String mObfuscatedAccountId; + private String mObfuscatedProfileId; private final BillingUpdatesListener mBillingUpdatesListener; private final List mPurchases = new ArrayList<>(); @@ -149,11 +149,11 @@ public class BillingManager implements PurchasesUpdatedListener { LOG.debug("Launching in-app purchase flow. Replace old SKU? " + (oldSku != null && purchaseToken != null)); BillingFlowParams.Builder paramsBuilder = BillingFlowParams.newBuilder() .setSkuDetails(skuDetails); - if (!TextUtils.isEmpty(mUserId)) { - paramsBuilder.setObfuscatedAccountId(mUserId); + if (!TextUtils.isEmpty(mObfuscatedAccountId)) { + paramsBuilder.setObfuscatedAccountId(mObfuscatedAccountId); } - if (!TextUtils.isEmpty(mUserToken)) { - paramsBuilder.setObfuscatedProfileId(mUserToken); + if (!TextUtils.isEmpty(mObfuscatedProfileId)) { + paramsBuilder.setObfuscatedProfileId(mObfuscatedProfileId); } if (oldSku != null && purchaseToken != null) { paramsBuilder.setOldSku(oldSku, purchaseToken); @@ -405,12 +405,12 @@ public class BillingManager implements PurchasesUpdatedListener { }); } - public void setUserId(String userId) { - mUserId = userId; + public void setObfuscatedAccountId(String obfuscatedAccountId) { + mObfuscatedAccountId = obfuscatedAccountId; } - public void setUserToken(String userToken) { - mUserToken = userToken; + public void setObfuscatedProfileId(String obfuscatedProfileId) { + mObfuscatedProfileId = obfuscatedProfileId; } private void executeServiceRequest(Runnable runnable) {