Pl - #190
Merged
Merged
Pl#190
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Billing failures can revoke valid entitlements, and several lifecycle and entitlement-state defects remain.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds premium billing, purchase-status checks, subscription management, and flavor-specific onboarding behavior.
Changes:
- Integrates Google Play Billing for the full flavor with FOSS-compatible stubs.
- Adds premium purchase UI, settings, entitlement checks, and warning states.
- Updates startup flows and OMDb setup behavior.
File summaries
| File | Description |
|---|---|
app/build.gradle.kts |
Adds billing dependencies and updates version. |
app/src/main/res/xml/preferences.xml |
Adds premium and subscription preferences. |
app/src/main/res/values/strings.xml |
Adds billing-related text. |
app/src/main/res/layout/fragment_billing_bottom_sheet.xml |
Defines the purchase sheet UI. |
app/src/main/java/.../SyncProviderBottomSheet.kt |
Starts FOSS OMDb setup after sync selection. |
app/src/main/java/.../SettingsFragment.kt |
Adds purchase and subscription settings. |
app/src/main/java/.../MainActivity.kt |
Schedules billing checks and updates onboarding. |
app/src/full/java/.../work/BillingCheckWorker.kt |
Periodically validates purchases. |
app/src/full/java/.../helper/BillingHelper.kt |
Implements Google Play Billing operations. |
app/src/full/java/.../fragment/BillingBottomSheetFragment.kt |
Implements the full-flavor purchase flow. |
app/src/full/java/.../data/PurchaseStatus.kt |
Defines purchase states. |
app/src/foss/java/.../work/BillingCheckWorker.kt |
Provides the FOSS worker stub. |
app/src/foss/java/.../helper/BillingHelper.kt |
Provides the FOSS billing stub. |
app/src/foss/java/.../fragment/BillingBottomSheetFragment.kt |
Provides the FOSS purchase-sheet behavior. |
app/src/foss/java/.../data/PurchaseStatus.kt |
Defines FOSS purchase states. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 8
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+242
to
+254
| } else if (resultInApp.responseCode == BillingClient.BillingResponseCode.SERVICE_DISCONNECTED || | ||
| resultInApp.responseCode == BillingClient.BillingResponseCode.SERVICE_UNAVAILABLE || | ||
| resultInApp.responseCode == BillingClient.BillingResponseCode.ERROR) { | ||
| if (resultInApp.responseCode == BillingClient.BillingResponseCode.ERROR || | ||
| resultInApp.responseCode == BillingClient.BillingResponseCode.SERVICE_DISCONNECTED) { | ||
| if (checkLocalPremiumStatus() == PurchaseStatus.PURCHASED) { | ||
| onResult(PurchaseStatus.PURCHASED) | ||
| return@queryPurchasesAsync | ||
| } | ||
| } | ||
| onResult(PurchaseStatus.ERROR) | ||
| return@queryPurchasesAsync | ||
| } |
Comment on lines
+285
to
+297
| } else if (resultSubs.responseCode == BillingClient.BillingResponseCode.SERVICE_DISCONNECTED || | ||
| resultSubs.responseCode == BillingClient.BillingResponseCode.SERVICE_UNAVAILABLE || | ||
| resultSubs.responseCode == BillingClient.BillingResponseCode.ERROR) { | ||
| if (resultSubs.responseCode == BillingClient.BillingResponseCode.ERROR || | ||
| resultSubs.responseCode == BillingClient.BillingResponseCode.SERVICE_DISCONNECTED) { | ||
| if (checkLocalPremiumStatus() == PurchaseStatus.PURCHASED) { | ||
| onResult(PurchaseStatus.PURCHASED) | ||
| return@queryPurchasesAsync | ||
| } | ||
| } | ||
| onResult(PurchaseStatus.ERROR) | ||
| return@queryPurchasesAsync | ||
| } |
Comment on lines
+321
to
+326
| val offerToken = productDetails.subscriptionOfferDetails?.firstOrNull()?.offerToken | ||
| if (offerToken != null) { | ||
| setOfferToken(offerToken) | ||
| } else { | ||
| return@apply | ||
| } |
| package com.wirelessalien.android.moviedb.data | ||
|
|
||
| enum class PurchaseStatus { | ||
| PURCHASED, |
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| super.onViewCreated(view, savedInstanceState) | ||
| billingHelper = BillingHelper(requireContext(), lifecycleScope) { _, _ -> } | ||
| billingHelper.checkPurchases { _ -> |
| if (hasActivePurchase && billingErrorTimestamp > 0) { | ||
| val currentTime = System.currentTimeMillis() | ||
| val timeElapsed = currentTime - billingErrorTimestamp | ||
| val timeLeft = 259200000L - timeElapsed |
|
|
||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| isCancelable = false |
Comment on lines
+113
to
+114
| billingHelper = BillingHelper(requireContext(), lifecycleScope) { status, errorMessage -> | ||
| lifecycleScope.launch(Dispatchers.Main) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.