Small renaming
This commit is contained in:
parent
83bd81eea7
commit
82f2138c07
2 changed files with 16 additions and 16 deletions
|
@ -200,7 +200,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper {
|
||||||
|
|
||||||
BillingManager billingManager = getBillingManager();
|
BillingManager billingManager = getBillingManager();
|
||||||
if (billingManager != null) {
|
if (billingManager != null) {
|
||||||
storeUserInfo(billingManager);
|
setupUserInfo(billingManager);
|
||||||
billingManager.initiatePurchaseFlow(activity, skuDetails);
|
billingManager.initiatePurchaseFlow(activity, skuDetails);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("BillingManager disposed");
|
throw new IllegalStateException("BillingManager disposed");
|
||||||
|
@ -228,7 +228,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper {
|
||||||
}
|
}
|
||||||
BillingManager billingManager = getBillingManager();
|
BillingManager billingManager = getBillingManager();
|
||||||
if (billingManager != null) {
|
if (billingManager != null) {
|
||||||
storeUserInfo(billingManager);
|
setupUserInfo(billingManager);
|
||||||
billingManager.initiatePurchaseFlow(activity, skuDetails);
|
billingManager.initiatePurchaseFlow(activity, skuDetails);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("BillingManager disposed");
|
throw new IllegalStateException("BillingManager disposed");
|
||||||
|
@ -568,7 +568,7 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper {
|
||||||
if (AndroidUtils.isActivityNotDestroyed(a) && skuDetails != null) {
|
if (AndroidUtils.isActivityNotDestroyed(a) && skuDetails != null) {
|
||||||
BillingManager billingManager = getBillingManager();
|
BillingManager billingManager = getBillingManager();
|
||||||
if (billingManager != null) {
|
if (billingManager != null) {
|
||||||
storeUserInfo(billingManager);
|
setupUserInfo(billingManager);
|
||||||
billingManager.initiatePurchaseFlow(a, skuDetails);
|
billingManager.initiatePurchaseFlow(a, skuDetails);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("BillingManager disposed");
|
throw new IllegalStateException("BillingManager disposed");
|
||||||
|
@ -620,10 +620,10 @@ public class InAppPurchaseHelperImpl extends InAppPurchaseHelper {
|
||||||
onPurchaseDone(getPurchaseInfo(purchase));
|
onPurchaseDone(getPurchaseInfo(purchase));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void storeUserInfo(BillingManager billingManager) {
|
private void setupUserInfo(BillingManager billingManager) {
|
||||||
OsmandSettings settings = ctx.getSettings();
|
OsmandSettings settings = ctx.getSettings();
|
||||||
billingManager.setUserId(settings.BILLING_USER_ID.get());
|
billingManager.setObfuscatedAccountId(settings.BILLING_USER_ID.get());
|
||||||
billingManager.setUserToken(settings.BILLING_USER_TOKEN.get());
|
billingManager.setObfuscatedProfileId(settings.BILLING_USER_TOKEN.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -58,8 +58,8 @@ public class BillingManager implements PurchasesUpdatedListener {
|
||||||
|
|
||||||
// Public key for verifying signature, in base64 encoding
|
// Public key for verifying signature, in base64 encoding
|
||||||
private String mSignatureBase64;
|
private String mSignatureBase64;
|
||||||
private String mUserId;
|
private String mObfuscatedAccountId;
|
||||||
private String mUserToken;
|
private String mObfuscatedProfileId;
|
||||||
|
|
||||||
private final BillingUpdatesListener mBillingUpdatesListener;
|
private final BillingUpdatesListener mBillingUpdatesListener;
|
||||||
private final List<Purchase> mPurchases = new ArrayList<>();
|
private final List<Purchase> 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));
|
LOG.debug("Launching in-app purchase flow. Replace old SKU? " + (oldSku != null && purchaseToken != null));
|
||||||
BillingFlowParams.Builder paramsBuilder = BillingFlowParams.newBuilder()
|
BillingFlowParams.Builder paramsBuilder = BillingFlowParams.newBuilder()
|
||||||
.setSkuDetails(skuDetails);
|
.setSkuDetails(skuDetails);
|
||||||
if (!TextUtils.isEmpty(mUserId)) {
|
if (!TextUtils.isEmpty(mObfuscatedAccountId)) {
|
||||||
paramsBuilder.setObfuscatedAccountId(mUserId);
|
paramsBuilder.setObfuscatedAccountId(mObfuscatedAccountId);
|
||||||
}
|
}
|
||||||
if (!TextUtils.isEmpty(mUserToken)) {
|
if (!TextUtils.isEmpty(mObfuscatedProfileId)) {
|
||||||
paramsBuilder.setObfuscatedProfileId(mUserToken);
|
paramsBuilder.setObfuscatedProfileId(mObfuscatedProfileId);
|
||||||
}
|
}
|
||||||
if (oldSku != null && purchaseToken != null) {
|
if (oldSku != null && purchaseToken != null) {
|
||||||
paramsBuilder.setOldSku(oldSku, purchaseToken);
|
paramsBuilder.setOldSku(oldSku, purchaseToken);
|
||||||
|
@ -405,12 +405,12 @@ public class BillingManager implements PurchasesUpdatedListener {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserId(String userId) {
|
public void setObfuscatedAccountId(String obfuscatedAccountId) {
|
||||||
mUserId = userId;
|
mObfuscatedAccountId = obfuscatedAccountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserToken(String userToken) {
|
public void setObfuscatedProfileId(String obfuscatedProfileId) {
|
||||||
mUserToken = userToken;
|
mObfuscatedProfileId = obfuscatedProfileId;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeServiceRequest(Runnable runnable) {
|
private void executeServiceRequest(Runnable runnable) {
|
||||||
|
|
Loading…
Reference in a new issue