Skip to content

Consolidate JcaFilePathGenerator into configurable DefaultFilePathGenerator - #640

Merged
davidjiagoogle merged 2 commits into
mainfrom
david/defaultFilePathGenerator
Nov 5, 2026
Merged

davidjiagoogle merged 2 commits into
mainfrom
david/defaultFilePathGenerator

Conversation

@davidjiagoogle

Copy link
Copy Markdown
Collaborator

Summary

  • Add DefaultFilePathGenerator in :core:common with configurable prefix and relativeOutputPath (defaulting to "JCA" and DCIM/Camera), allowing client applications to customize output filenames and directory paths while sharing the default implementation.
  • Add DefaultFilePathGeneratorTest Robolectric unit tests in :core:common.
  • Update AppModule in :app to provide DefaultFilePathGenerator() and remove JcaFilePathGenerator and the redundant @DefaultFilePathGenerator qualifier.

…erator

- Add DefaultFilePathGenerator in :core:common with configurable prefix and relativeOutputPath (defaulting to JCA and DCIM/Camera)

- Add DefaultFilePathGeneratorTest Robolectric unit tests

- Update AppModule to provide DefaultFilePathGenerator and remove JcaFilePathGenerator

- Remove redundant @DefaultFilePathGenerator qualifier from :app

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the file path generation logic by replacing the local JcaFilePathGenerator with a more configurable DefaultFilePathGenerator in the core:common module, and removes the now-redundant @DefaultFilePathGenerator dependency injection qualifier. Additionally, a comprehensive suite of unit tests has been added for the new generator. The feedback suggests optimizing the timestamp generation in DefaultFilePathGenerator by using System.currentTimeMillis() instead of Date().time to avoid unnecessary object allocations.

@davidjiagoogle
davidjiagoogle merged commit 83d9535 into main Nov 5, 2026
11 of 12 checks passed
@davidjiagoogle
davidjiagoogle deleted the david/defaultFilePathGenerator branch November 5, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants