Skip to content

Conversation

@hb0
Copy link
Collaborator

@hb0 hb0 commented Dec 8, 2025

Creates a new StorageHelper utility class that provides robust storage selection with fallback logic. The helper tries primary external storage first (checking if it's mounted and writable), then falls back to internal storage if external is unavailable.

This replaces the previous approach where external storage was required and would throw exceptions if unavailable. The new approach ensures the app can always find a suitable storage location.

Changes:

  • Add StorageHelper.getStorageDirectoryWithFallback() for File objects
  • Add StorageHelper.getStoragePathWithFallback() for String paths
  • Update DiskConsumption to use StorageHelper (requires Context parameter)
  • Remove Constants.externalCyfaceFolderPath() (replaced by StorageHelper)
  • Only uses primary external storage, avoiding removable media

Creates a new StorageHelper utility class that provides robust storage
selection with fallback logic. The helper tries primary external storage
first (checking if it's mounted and writable), then falls back to internal
storage if external is unavailable.

This replaces the previous approach where external storage was required
and would throw exceptions if unavailable. The new approach ensures the
app can always find a suitable storage location.

Changes:
- Add StorageHelper.getStorageDirectoryWithFallback() for File objects
- Add StorageHelper.getStoragePathWithFallback() for String paths
- Update DiskConsumption to use StorageHelper (requires Context parameter)
- Remove Constants.externalCyfaceFolderPath() (replaced by StorageHelper)
- Only uses primary external storage, avoiding removable media
@hb0 hb0 self-assigned this Dec 8, 2025
@hb0 hb0 merged commit 8d89d95 into main Dec 8, 2025
1 of 2 checks passed
@hb0 hb0 deleted the task/LEIP-409_handle-no-external-files-dir-existing branch December 8, 2025 10:27
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