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

[Android] remove old widgets on upgrade scenario #16744

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

tapanmodh
Copy link
Contributor

@tapanmodh tapanmodh commented Jan 19, 2023

Resolves brave/brave-browser#27757

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • 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 lint, 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:

  1. Install 1.46.x
  2. Launch Brave
  3. Add brave quick action widget on home screen
  4. Upgrade this build
  5. Open brave app once
  6. Attempt to add another widget from home screen long press.
  7. Observe list of widgets under brave

@tapanmodh tapanmodh added CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS labels Jan 19, 2023
@tapanmodh tapanmodh added this to the 1.49.x - Nightly milestone Jan 19, 2023
@tapanmodh tapanmodh requested a review from a team as a code owner January 19, 2023 14:15
@tapanmodh tapanmodh self-assigned this Jan 19, 2023
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

}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing new line at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was missing in the master. I have added in the commit

Copy link
Contributor

@deeppandya deeppandya left a comment

Choose a reason for hiding this comment

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

LGTM

import org.chromium.chrome.browser.quickactionsearchwidget.QuickActionSearchWidgetProvider;

public abstract class BraveQuickActionSearchWidgetProvider extends QuickActionSearchWidgetProvider {
public static void setWidgetEnabled(
boolean shouldEnableQuickActionSearchWidget, boolean shouldEnableDinoVariant) {
// We don't need to do anything here as in QuickActionSearchWidgetProvider we only set dino
// and quick search widgets.
setWidgetComponentEnabled(QuickActionSearchWidgetProviderSearch.class, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems we need to remove widgets explicitly. good find.

@tapanmodh tapanmodh merged commit db47d43 into master Jan 19, 2023
@tapanmodh tapanmodh deleted the remove_old_widgets_upgrade_android branch January 19, 2023 20:35
brave-builds added a commit that referenced this pull request Jan 19, 2023
brave-builds added a commit that referenced this pull request Jan 19, 2023
@Uni-verse
Copy link
Contributor

Uni-verse commented Jan 20, 2023

Verified on Samsung Galaxy S21 using version:

Brave	1.49.45 Chromium: 109.0.5414.87 (Official Build) canary (32-bit) 
Revision	2dc18eb511c56e012081b4abc9e38c81c885f7d4-refs/branch-heads/5414@{#1241}
OS	Android 13; Build/TP1A.220624.014

Upgraded Profile

  1. Installed 1.46.68 Nightly build - https://github.com/brave/brave-browser/releases/tag/v1.46.68
  2. Confirm that brave widget list has 4 items
  3. Added all 4 brave widgets to home screen
  4. Upgraded to 1.49.45
  5. Check home screen to ensure that old widgets are removed (brave dino and legacy quick action widget)
  6. Confirm that brave widget list now contains 3 items (search widget, bookmarks widget and new quick action widget)
  • Verified that legacy widgets are being removed from home screen on upgraded profile
  • Verified brave widget list contains 3 items.
  • Verified user is able to add the new quick action widget via settings -> homescreen widget and home screen widget window
1.46.68 1.46.68 1.46.68
screenshot-1674246640788 screenshot-1674246533046 screenshot-1674246539636
1.49.45 1.49.45 1.49.45
screenshot-1674246676909 screenshot-1674246709881 screenshot-1674246718699

Fresh Profile

  1. Install 1.49.45 nightly build
  2. Confirm brave widget list shows 3 items
  3. Confirm user can add new quick action widget to the home screen
Example Example
screenshot-1674247458112 screenshot-1674247470986

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Old widgets are not removed in widget list on upgraded profile
5 participants