Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
spacing and punctuation in comments
  • Loading branch information
Gray Mackall committed Jul 7, 2023
commit ff6a8179319182754deceb7dc3938a457366db2e
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ static final class MethodNames {
private MethodNames() {}
}

// TODO(gmackall) Replace uses of deprecated ProrationMode enum values with new
// TODO(gmackall): Replace uses of deprecated ProrationMode enum values with new
// ReplacementMode enum values.
// https://github.com/flutter/flutter/issues/128957
// https://github.com/flutter/flutter/issues/128957.
@SuppressWarnings(value = "deprecation")
private static final int PRORATION_MODE_UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY =
com.android.billingclient.api.BillingFlowParams.ProrationMode
Expand Down Expand Up @@ -329,16 +329,16 @@ private void launchBillingFlow(
BillingFlowParams.SubscriptionUpdateParams.newBuilder();
if (oldProduct != null && !oldProduct.isEmpty() && purchaseToken != null) {
subscriptionUpdateParamsBuilder.setOldPurchaseToken(purchaseToken);
//Set the prorationMode using a helper to minimize impact of deprecation suppression.
// Set the prorationMode using a helper to minimize impact of deprecation suppression.
setReplaceProrationMode(subscriptionUpdateParamsBuilder, prorationMode);
paramsBuilder.setSubscriptionUpdateParams(subscriptionUpdateParamsBuilder.build());
}
result.success(
fromBillingResult(billingClient.launchBillingFlow(activity, paramsBuilder.build())));
}

// TODO(gmackall): Replace uses of deprecated setReplaceProrationMode
// https://github.com/flutter/flutter/issues/128957
// TODO(gmackall): Replace uses of deprecated setReplaceProrationMode.
// https://github.com/flutter/flutter/issues/128957.
@SuppressWarnings(value = "deprecation")
private void setReplaceProrationMode(
BillingFlowParams.SubscriptionUpdateParams.Builder builder, int prorationMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ public void launchBillingFlow_ok_AccountId() {
verify(result, times(1)).success(fromBillingResult(billingResult));
}

// TODO(gmackall): Replace uses of deprecated ProrationMode enum values with new
// ReplacementMode enum values.
// https://github.com/flutter/flutter/issues/128957.
@Test
@SuppressWarnings(value = "deprecation")
public void launchBillingFlow_ok_Proration() {
Expand Down Expand Up @@ -454,6 +457,9 @@ public void launchBillingFlow_ok_Proration() {
verify(result, times(1)).success(fromBillingResult(billingResult));
}

// TODO(gmackall): Replace uses of deprecated ProrationMode enum values with new
// ReplacementMode enum values.
// https://github.com/flutter/flutter/issues/128957.
@Test
@SuppressWarnings(value = "deprecation")
public void launchBillingFlow_ok_Proration_with_null_OldProduct() {
Expand Down Expand Up @@ -489,6 +495,9 @@ public void launchBillingFlow_ok_Proration_with_null_OldProduct() {
verify(result, never()).success(any());
}

// TODO(gmackall): Replace uses of deprecated ProrationMode enum values with new
// ReplacementMode enum values.
// https://github.com/flutter/flutter/issues/128957.
@Test
@SuppressWarnings(value = "deprecation")
public void launchBillingFlow_ok_Full() {
Expand Down