Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New restore subscription android #23725

Merged
merged 5 commits into from
May 23, 2024
Merged

Conversation

deeppandya
Copy link
Contributor

@deeppandya deeppandya commented May 17, 2024

Resolves brave/brave-browser#38085

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Please reach out to @deeppandya for more details on testing

@deeppandya deeppandya added CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS CI/skip-windows-x64 Do not run CI builds for Windows x64 unused-CI/skip-linux-x64 Do not run CI builds for Linux x64 labels May 17, 2024
@deeppandya deeppandya added this to the 1.68.x - Nightly milestone May 17, 2024
@deeppandya deeppandya self-assigned this May 17, 2024
@deeppandya deeppandya requested a review from a team as a code owner May 17, 2024 05:30
Copy link
Contributor

@samartnik samartnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@SergeyZhukovsky
Copy link
Member

Just a general question: how does it suppose to look when a user has mobile only purchase? Do we always show the restore button? As I don't think we can restore credentials if the account isn't linked.

@deeppandya deeppandya changed the title New restore subscription android [WIP]New restore subscription android May 21, 2024
@deeppandya deeppandya marked this pull request as draft May 21, 2024 19:19
@deeppandya deeppandya force-pushed the new_restore_subscription_android branch from 3fc00ba to bd573b4 Compare May 22, 2024 00:14
@deeppandya deeppandya changed the title [WIP]New restore subscription android New restore subscription android May 22, 2024
@deeppandya deeppandya force-pushed the new_restore_subscription_android branch from bd573b4 to 42c09c2 Compare May 22, 2024 18:10
@deeppandya deeppandya marked this pull request as ready for review May 22, 2024 18:11
Copy link
Collaborator

@mkarolin mkarolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings++

Copy link
Member

@SergeyZhukovsky SergeyZhukovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@deeppandya deeppandya force-pushed the new_restore_subscription_android branch from 2502ca5 to 52de317 Compare May 23, 2024 03:39
Copy link
Contributor

[puLL-Merge] - brave/brave-core@23725

Description

This PR makes several changes related to subscription linking and management for the Brave browser's VPN and AI chat (Leo) features on Android. It updates UI elements on the subscription plans pages, adds new utility functions for handling subscription linking, and removes some unused code.

Changes

Changes

  • android/brave_java_resources.gni: Adds a new drawable resource refresh_credentials_bg.xml
  • android/java/org/chromium/chrome/browser/billing/LinkSubscriptionUtils.java: Adds new utility class with functions to get Brave account URLs for linking subscriptions and refreshing credentials, with support for staging environment
  • android/java/org/chromium/chrome/browser/brave_leo/BraveLeoPlansActivity.java, android/java/org/chromium/chrome/browser/vpn/activities/BraveVpnPlansActivity.java: Adds a "Refresh your credentials" button to the Leo and VPN subscription plans pages that links to Brave account
  • Various files: Updates code to use the new LinkSubscriptionUtils functions instead of hardcoded URLs
  • android/java/org/chromium/chrome/browser/settings/developer/BraveQAPreferences.java:
    • Renames PREF_USE_LEO_STAGING_SERVER to PREF_LINK_SUBSCRIPTION_ON_STAGING
    • Removes isLeoStagingUsed() function
  • android/java/org/chromium/chrome/browser/util/TabUtils.java: Adds openURLWithBraveActivity() utility function
  • android/java/org/chromium/chrome/browser/vpn/utils/BraveVpnPrefUtils.java:
    • Removes PREF_BRAVE_VPN_LINK_SUBSCRIPTION_ON_STAGING constant
    • Removes isLinkSubscriptionOnStaging() and setLinkSubscriptionOnStaging() functions
  • Various resource files: Adds/updates colors, dimensions, styles for UI changes

Security Hotspots

None found. The changes do not appear to introduce any new security risks.

@deeppandya deeppandya merged commit 9e1fc38 into master May 23, 2024
19 checks passed
@deeppandya deeppandya deleted the new_restore_subscription_android branch May 23, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 puLL-Merge unused-CI/skip-linux-x64 Do not run CI builds for Linux x64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Fix Refresh credentials flow for mobile users
4 participants