Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #26424 - Handle special legacy wallpaper cases #27137

Merged
merged 2 commits into from
Sep 28, 2022

Conversation

Alexandru2909
Copy link
Contributor

@Alexandru2909 Alexandru2909 commented Sep 23, 2022

Handle special cases for drawable legacy wallpapers and "beach-vibe" wallpaper which is named "beach-vibes" in V2, according to comment.

Videos of upgrading from 105 to 106:

device-2022-09-23-180025.mp4
device-2022-09-23-171746.mp4

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

QA

  • QA Needed

To download an APK when reviewing a PR (after all CI tasks finished running):

  1. Click on Checks at the top of the PR page.
  2. Click on the firefoxci-taskcluster group on the left to expand all tasks.
  3. Click on the build-debug task.
  4. Click on View task in Taskcluster in the new DETAILS section.
  5. The APK links should be on the right side of the screen, named for each CPU architecture.

GitHub Automation

Fixes #26424

Copy link
Contributor

@MatthewTighe MatthewTighe left a comment

Choose a reason for hiding this comment

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

Couple suggestions, but this otherwise LGTM

if (settings.shouldMigrateLegacyWallpaper) {
migrationHelper.migrateLegacyWallpaper(currentWallpaperName)
migrationHelper.migrateLegacyWallpaper(settings.currentWallpaperName)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could move this second (settings.shouldMigrateLegacyWallpaper) into the first one.

Comment on lines 107 to 112
internal fun getMigratedWallpaperName(wallpaperName: String) =
if (wallpaperName == beachVibeName) {
"beach-vibes"
} else {
wallpaperName
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we will also want to update settings with the new name.

@@ -29,6 +35,21 @@ class LegacyWallpaperMigration(
suspend fun migrateLegacyWallpaper(
Copy link
Contributor

Choose a reason for hiding this comment

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

We could potentially update this function to return the migrated (or the same, if unchanged) name instead of splitting the behavior into two functions.

@MatthewTighe
Copy link
Contributor

Latest updates look good! Please land when able, we will want to uplift this for 106

@Alexandru2909 Alexandru2909 added the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Sep 28, 2022
@mergify mergify bot merged commit 1968517 into mozilla-mobile:main Sep 28, 2022
@Alexandru2909
Copy link
Contributor Author

@mergify backport releases_v106.0.0

@mergify
Copy link
Contributor

mergify bot commented Sep 28, 2022

backport releases_v106.0.0

✅ Backports have been created

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:needs-landing PRs that are ready to land [Will be merged by Mergify]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create wallpaper file migration helper
2 participants