Skip to content

Cleanup: Fix warnings and improve safety in BackupManager.kt#20345

Open
jatinfoujdar wants to merge 1 commit intoankidroid:mainfrom
jatinfoujdar:fix-backupmanager-null-locale
Open

Cleanup: Fix warnings and improve safety in BackupManager.kt#20345
jatinfoujdar wants to merge 1 commit intoankidroid:mainfrom
jatinfoujdar:fix-backupmanager-null-locale

Conversation

@jatinfoujdar
Copy link

Purpose / Description

The goal of this PR is to resolve several Android Studio warnings and improve code safety in BackupManager.kt
. This is a contribution for the "Good First Issue" task designed for new contributors.

Fixes

Approach

Added Locale.US to SimpleDateFormat instances (legacyDateFormat and newDateFormat). This ensures that backup date formatting is consistent and doesn't depend on the device's system locale, which resolves a common "Implicitly using the default locale" warning.

How Has This Been Tested?

-Manual Verification: I performed a manual review of the logic to ensure that safe calls and fallbacks maintain the original directory navigation behavior while preventing crashes.

-Code Review: Verified that all !! associated with listFiles() and parentFile in this file have been addressed.r or physical, etc)

Learning (optional, can help others)

Describe the research stage

Links to blog posts, patterns, libraries or addons used to solve this problem

Checklist

Please, go through these checks before submitting the PR.

  • [x ] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [ x] You have commented your code, particularly in hard-to-understand areas
  • [ x] You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

…nd ensure locale consistency in date formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cleanup]: Fix Android Studio Warnings

2 participants